Skip to content

Commit

Permalink
🐛 chore: rearrange code
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfram77 committed May 7, 2023
1 parent 97abbea commit b7b4353
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
44 changes: 22 additions & 22 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,28 +130,6 @@ function toSet<T, U=T>(x: T[], fm: MapFunction<T, U> | null=null): Set<T|U> {
// #region GENERATE
// ----------------

/**
* Convert an iterable to array.
* @param x an iterable
* @returns x as array
*/
export function fromIterable<T>(x: Iterable<T>): 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$<T>(x: Iterable<T>): T[] {
return Array.isArray(x)? x : [...x];
}
export {fromIterable$ as from$};


/**
* Generate array from given number range.
* @param v start number
Expand Down Expand Up @@ -197,6 +175,28 @@ export function fromApplication<T>(fm: MapFunction<T, T>, 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<T>(x: Iterable<T>): 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$<T>(x: Iterable<T>): T[] {
return Array.isArray(x)? x : [...x];
}
export {fromIterable$ as from$};
// #endregion


Expand Down

0 comments on commit b7b4353

Please sign in to comment.