UNPKG

1.34 kBSource Map (JSON)View Raw
1{"version":3,"sources":["iterable/every.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,KAAK,CAAI,MAAmB,EAAE,OAAuB;IACnE,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,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE;YACvC,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC","file":"every.js","sourcesContent":["import { FindOptions } from './findoptions';\n\n/**\n * Determines whether all elements of an iterable sequence satisfy 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 {FindOptions<T>} options The options for a predicate for filtering, thisArg for binding and AbortSignal for cancellation.\n * @returns {boolean} A boolean determining whether all elements in the source sequence pass the test in the specified predicate.\n */\nexport function every<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 false;\n }\n }\n return true;\n}\n"]}
\No newline at end of file