export function isObject(value) {
    return value !== null && typeof value === 'object';
}
export function isArray(value) {
    return Array.isArray(value);
}
export function filterProperties(object, filter, options, path) {
    if (path === void 0) { path = []; }
    return Object.keys(object).reduce(function (result, key) {
        var currentVal = object[key];
        var value = currentVal;
        if (filter(object, key, path.concat(key))) {
            if (isObject(currentVal) && options.deep) {
                value = filterProperties(currentVal, filter, options, path.concat(key));
            }
            if (isArray(result)) {
                result.push(value);
            }
            else {
                result[key] = value;
            }
        }
        return result;
    }, (isArray(object) ? [] : {}));
}
