UNPKG

807 BSource Map (JSON)View Raw
1{"version":3,"sources":["iterable/toarray.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAU,MAAyB;IACxD,MAAM,OAAO,GAAG,EAAe,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE;QACzB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACpB;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","file":"toarray.js","sourcesContent":["/**\n * Converts an existing iterable to anarray of values.\n *\n * @export\n * @template TSource The type of elements in the source sequence.\n * @param {Iterable<TSource>} source The source sequence to convert to an array.\n * @returns {TSource[]} All the items from the source sequence as an array.\n */\nexport function toArray<TSource>(source: Iterable<TSource>): TSource[] {\n const results = [] as TSource[];\n for (const item of source) {\n results.push(item);\n }\n return results;\n}\n"]}
\No newline at end of file