UNPKG

700 BSource Map (JSON)View Raw
1{"version":3,"sources":["iterable/isempty.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAI,MAAmB;IAC5C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;QACtB,OAAO,KAAK,CAAC;KACd;IACD,OAAO,IAAI,CAAC;AACd,CAAC","file":"isempty.js","sourcesContent":["/**\n * Determines whether the given async-iterable is empty.\n *\n * @export\n * @template T The type of elements in the source sequence.\n * @param {Iterable<T>} source The source async-iterable to determine whether it is empty.\n * @returns {boolean} Returns true if the sequence is empty, otherwise false.\n */\nexport function isEmpty<T>(source: Iterable<T>): boolean {\n for (const _ of source) {\n return false;\n }\n return true;\n}\n"]}
\No newline at end of file