MCPcopy Index your code
hub / github.com/extrabacon/python-shell / toArray

Function toArray

index.ts:9–16  ·  view source on GitHub ↗
(source?: T | T[])

Source from the content-addressed store, hash-verified

7import { promisify } from 'util';
8
9function toArray<T>(source?: T | T[]): T[] {
10 if (typeof source === 'undefined' || source === null) {
11 return [];
12 } else if (!Array.isArray(source)) {
13 return [source];
14 }
15 return source;
16}
17
18/**
19 * adds arguments as properties to obj

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…