MCPcopy Create free account
hub / github.com/immutable-js/immutable-js / seqFromValue

Function seqFromValue

src/Seq.js:320–335  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

318}
319
320function seqFromValue(value) {
321 const seq = maybeIndexedSeqFromValue(value);
322 if (seq) {
323 return isEntriesIterable(value)
324 ? seq.fromEntrySeq()
325 : isKeysIterable(value)
326 ? seq.toSetSeq()
327 : seq;
328 }
329 if (typeof value === 'object') {
330 return new ObjectSeq(value);
331 }
332 throw new TypeError(
333 'Expected Array or collection object of values, or keyed object: ' + value
334 );
335}
336
337function maybeIndexedSeqFromValue(value) {
338 return isArrayLike(value)

Callers 1

constructorMethod · 0.85

Calls 5

isEntriesIterableFunction · 0.90
isKeysIterableFunction · 0.90
maybeIndexedSeqFromValueFunction · 0.85
fromEntrySeqMethod · 0.80
toSetSeqMethod · 0.65

Tested by

no test coverage detected