arrays.js 504 B

1234567891011121314151617181920
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var lodashUnified = require('lodash-unified');
  4. const unique = (arr) => [...new Set(arr)];
  5. const castArray = (arr) => {
  6. if (!arr && arr !== 0)
  7. return [];
  8. return Array.isArray(arr) ? arr : [arr];
  9. };
  10. Object.defineProperty(exports, 'ensureArray', {
  11. enumerable: true,
  12. get: function () { return lodashUnified.castArray; }
  13. });
  14. exports.castArray = castArray;
  15. exports.unique = unique;
  16. //# sourceMappingURL=arrays.js.map