Encapsulates a non array value with an array that contains it unless the value is already an array
Example usage:
import { arrayize } from "@thalesrc/js-utils"; const foo = 'foo'; const bar = ['bar']; const fooArr = arrayize(foo); // ['foo']; const barArr = arrayize(bar); // ['bar'];
Array or single value to capsulate
Generated using TypeDoc
Encapsulates a non array value with an array that contains it unless the value is already an array
Example usage:
import { arrayize } from "@thalesrc/js-utils"; const foo = 'foo'; const bar = ['bar']; const fooArr = arrayize(foo); // ['foo']; const barArr = arrayize(bar); // ['bar'];