UNPKG

1.39 kBSource Map (JSON)View Raw
1{"version":3,"sources":["iterable/some.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,IAAI,CAAI,MAAmB,EAAE,OAAuB;IAClE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACnE,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE;QACzB,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE;YACtC,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"some.js","sourcesContent":["import { FindOptions } from './findoptions';\n\n/**\n * Determines whether any element of an iterable sequence satisfies a condition.\n *\n * @export\n * @template T The type of the elements in the source sequence.\n * @param {Iterable<T>} source An iterable sequence whose elements to apply the predicate to.\n * @param {FindSubclassedOptions<T, S>} options The options which includes a required predicate, an optional\n * thisArg for binding, and an abort signal for cancellation.\n * @returns {boolean} Returns a boolean determining whether any elements in the source sequence\n * pass the test in the specified predicate.\n */\nexport function some<T>(source: Iterable<T>, options: FindOptions<T>): boolean {\n const { ['thisArg']: thisArg, ['predicate']: predicate } = options;\n let i = 0;\n for (const item of source) {\n if (predicate.call(thisArg, item, i++)) {\n return true;\n }\n }\n return false;\n}\n"]}
\No newline at end of file