declarative-js
Version:
_declarative-js_ is modern JavaScript library, that helps to: - tackle array transformation with built in JavaScript array api (e.g. `array.filter(toBe.unique())`), - provide a type-level solution for representing optional values instead of null referen
16 lines (15 loc) • 380 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// tslint:disable-next-line
exports.toArray = function (value) {
if (value !== null && value !== void 0) {
if (Array.isArray(value)) {
return value;
}
return [value];
}
else {
// tslint:disable-next-line
return [];
}
};