UNPKG

1.4 kBSource Map (JSON)View Raw
1{"version":3,"sources":["iterable/partition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAYpD,MAAM,UAAU,SAAS,CACvB,MAAmB,EACnB,SAA+C,EAC/C,OAAa;IAEb,MAAM,EAAE,GAAG,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,KAAQ,EAAE,KAAa,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC9F,OAAO,CAAC,IAAI,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAC7E,CAAC","file":"partition.js","sourcesContent":["import { IterableX } from './iterablex';\nimport { FilterIterable } from './operators/filter';\nimport { bindCallback } from '../util/bindcallback';\n\nexport function partition<T, S extends T>(\n source: Iterable<T>,\n predicate: (value: T, index: number) => value is S,\n thisArg?: any\n): IterableX<S>[];\nexport function partition<T>(\n source: Iterable<T>,\n predicate: (value: T, index: number) => boolean,\n thisArg?: any\n): IterableX<T>[];\nexport function partition<T>(\n source: Iterable<T>,\n predicate: (value: T, index: number) => boolean,\n thisArg?: any\n): IterableX<T>[] {\n const cb = bindCallback(predicate, thisArg, 2);\n const notCb = bindCallback((value: T, index: number) => !predicate(value, index), thisArg, 2);\n return [new FilterIterable(source, cb), new FilterIterable(source, notCb)];\n}\n"]}
\No newline at end of file