Comparing version 2.0.0-beta.14 to 2.0.0-beta.15
@@ -30,6 +30,6 @@ import { Model } from './Model'; | ||
*/ | ||
filter<S>(inputPath: PathLike, additionalInputPaths: PathLike[], options: PaginationOptions, fn: FilterFn<S>): Filter<S>; | ||
filter<S>(inputPath: PathLike, additionalInputPaths: PathLike[], fn: FilterFn<S>): Filter<S>; | ||
filter<S>(inputPath: PathLike, options: PaginationOptions, fn: FilterFn<S>): Filter<S>; | ||
filter<S>(inputPath: PathLike, fn: FilterFn<S>): Filter<S>; | ||
filter<S>(inputPath: PathLike, additionalInputPaths: PathLike[], options: PaginationOptions, fn?: FilterFn<S>): Filter<S>; | ||
filter<S>(inputPath: PathLike, additionalInputPaths: PathLike[], fn?: FilterFn<S>): Filter<S>; | ||
filter<S>(inputPath: PathLike, options: PaginationOptions, fn?: FilterFn<S>): Filter<S>; | ||
filter<S>(inputPath: PathLike, fn?: FilterFn<S>): Filter<S>; | ||
removeAllFilters: (subpath: Path) => void; | ||
@@ -36,0 +36,0 @@ /** |
@@ -24,6 +24,24 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
function parseFilterArguments(model, args) { | ||
var fn = args.pop(); | ||
var options, inputPaths; | ||
var fn, options, inputPaths; | ||
// first arg always path | ||
var path = model.path(args.shift()); | ||
if (!args.length) { | ||
return { | ||
path: path, | ||
inputPaths: null, | ||
options: options, | ||
fn: function () { return true; }, | ||
}; | ||
} | ||
var last = args[args.length - 1]; | ||
if (typeof last === 'function') { | ||
// fn null if optional | ||
// filter can be string | ||
fn = args.pop(); | ||
} | ||
if (args.length && fn == null) { | ||
// named function | ||
fn = args.pop(); | ||
} | ||
last = args[args.length - 1]; | ||
if (!model.isPath(last) && !Array.isArray(last)) { | ||
@@ -30,0 +48,0 @@ options = args.pop(); |
@@ -232,9 +232,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
if (typeof arguments[1] === 'function') { | ||
// (value, callback) | ||
value = arguments[0]; | ||
cb = arguments[1]; | ||
} | ||
else { | ||
else if (typeof arguments[0] === 'string' && typeof arguments[1] === 'object') { | ||
// (path, value) | ||
subpath = arguments[0]; | ||
value = arguments[1]; | ||
} | ||
else { | ||
// (value, null) | ||
value = arguments[0]; | ||
cb = arguments[1]; | ||
} | ||
} | ||
@@ -241,0 +248,0 @@ else { |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "2.0.0-beta.14", | ||
"version": "2.0.0-beta.15", | ||
"main": "./lib/index.js", | ||
@@ -15,0 +15,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
311758
8333