UNPKG

833 BSource Map (JSON)View Raw
1{"version":3,"sources":["iterable/toset.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAU,MAAyB;IACtD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAW,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE;QACzB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACf;IACD,OAAO,GAAG,CAAC;AACb,CAAC","file":"toset.js","sourcesContent":["/**\n * Converts the existing iterable into a promise which resolves a Set.\n *\n * @export\n * @template TSource The type of elements in the source sequence.\n * @param {Iterable<TSource>} source The iterable to convert into a set.\n * @returns {Set<TSource>} A promise which contains a Set with all the elements from the iterable.\n */\nexport function toSet<TSource>(source: Iterable<TSource>): Set<TSource> {\n const set = new Set<TSource>();\n for (const item of source) {\n set.add(item);\n }\n return set;\n}\n"]}
\No newline at end of file