"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.walk = void 0;
const walk = (value, callback) => {
    callback(value);
    if (typeof value === 'object') {
        if (!value)
            return;
        switch (value.constructor) {
            case Array: {
                const arr = value;
                const length = arr.length;
                for (let i = 0; i < length; i++)
                    (0, exports.walk)(arr[i], callback);
                break;
            }
            case Object: {
                const obj = value;
                for (const key in obj)
                    (0, exports.walk)(obj[key], callback);
                break;
            }
            case Map:
            case Set: {
                const mapOrSet = value;
                mapOrSet.forEach((val) => (0, exports.walk)(val, callback));
                break;
            }
        }
    }
};
exports.walk = walk;
//# sourceMappingURL=index.js.map