toList.js 350 B

12345678910111213
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. const toList = (candidate, skipEmpty = false) => {
  7. if (skipEmpty && (candidate === undefined || candidate === null)) {
  8. return [];
  9. }
  10. return Array.isArray(candidate) ? candidate : [candidate];
  11. };
  12. var _default = exports.default = toList;