MCPcopy
hub / github.com/PrismJS/prism / toArray

Function toArray

tests/dependencies-test.js:254–262  ·  view source on GitHub ↗

* @param {T | T[] | undefined | null} value * @returns {T[]} * @template T

(value)

Source from the content-addressed store, hash-verified

252 * @template T
253 */
254 function toArray(value) {
255 if (Array.isArray(value)) {
256 return value;
257 } else if (value == undefined) {
258 return [];
259 } else {
260 return [value];
261 }
262 }
263
264 /**
265 * @param {(entry: import("../dependencies").ComponentEntry, id: string, entries: Object<string, import("../dependencies").ComponentEntry>) => void} consumeFn

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected