UNPKG

1.17 kBSource Map (JSON)View Raw
1{"version":3,"sources":["iterable/of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,UAAU,EAAE,CAAU,GAAG,IAAe;IAC5C,OAAO,IAAI,UAAU,CAAU,IAAI,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,OAAO,UAAoB,SAAQ,SAAkB;IAGzD,YAAY,IAAe;QACzB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF","file":"of.js","sourcesContent":["import { IterableX } from './iterablex';\n\n/**\n * Creates an iterable from the specified elements.\n *\n * @export\n * @template TSource The type of the elements to create an iterable sequence.\n * @param {...TSource[]} args The elements to turn into an iterable sequence.\n * @returns {IterableX<TSource>} The iterable sequence created from the elements.\n */\nexport function of<TSource>(...args: TSource[]): IterableX<TSource> {\n return new OfIterable<TSource>(args);\n}\n\nexport class OfIterable<TSource> extends IterableX<TSource> {\n private _args: TSource[];\n\n constructor(args: TSource[]) {\n super();\n this._args = args;\n }\n\n *[Symbol.iterator]() {\n yield* this._args;\n }\n}\n"]}
\No newline at end of file