diff --git a/package-lock.json b/package-lock.json index 709bccd75..1779557fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "extra-array", - "version": "4.0.2", + "version": "4.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "extra-array", - "version": "4.0.2", + "version": "4.0.3", "license": "MIT", "devDependencies": { "@rollup/plugin-commonjs": "^24.1.0", diff --git a/package.json b/package.json index 0260fc9dc..51019955e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "extra-array", - "version": "4.0.2", + "version": "4.0.3", "description": "An array is a collection of values, stored contiguously.", "main": "index.js", "module": "index.mjs", diff --git a/src/index.ts b/src/index.ts index 9b79fb9ca..638e21c3f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -130,28 +130,6 @@ function toSet(x: T[], fm: MapFunction | null=null): Set { // #region GENERATE // ---------------- -/** - * Convert an iterable to array. - * @param x an iterable - * @returns x as array - */ -export function fromIterable(x: Iterable): T[] { - return [...x]; -} -export {fromIterable as from}; - - -/** - * Convert an iterable to array! - * @param x an iterable (updatable if array!) - * @returns x as array - */ -export function fromIterable$(x: Iterable): T[] { - return Array.isArray(x)? x : [...x]; -} -export {fromIterable$ as from$}; - - /** * Generate array from given number range. * @param v start number @@ -197,6 +175,28 @@ export function fromApplication(fm: MapFunction, v: T, n: number): T[] return a; } export {fromApplication as fromApply}; + + +/** + * Convert an iterable to array. + * @param x an iterable + * @returns x as array + */ +export function fromIterable(x: Iterable): T[] { + return [...x]; +} +export {fromIterable as from}; + + +/** + * Convert an iterable to array! + * @param x an iterable (updatable if array!) + * @returns x as array + */ +export function fromIterable$(x: Iterable): T[] { + return Array.isArray(x)? x : [...x]; +} +export {fromIterable$ as from$}; // #endregion