MCPcopy Create free account
hub / github.com/blacksmithgu/datacore / from

Function from

src/api/data-array.ts:476–482  ·  view source on GitHub ↗
(raw: Iterable<T>)

Source from the content-addressed store, hash-verified

474
475 /** Create a new DataArray from an iterable object. */
476 export function from<T>(raw: Iterable<T>): DataArray<T> {
477 if (isDataArray(raw)) return raw as DataArray<T>;
478
479 let data = [];
480 for (let elem of raw) data.push(elem);
481 return DataArrayImpl.wrap(data);
482 }
483
484 /** Return true if the given object is a data array. */
485 export function isDataArray(obj: unknown): obj is DataArray<unknown> {

Callers

nothing calls this directly

Calls 2

isDataArrayFunction · 0.85
wrapMethod · 0.80

Tested by

no test coverage detected