@lite-v3/common-helpers
Advanced tools
Comparing version 0.0.14 to 0.1.0-alpha.1
@@ -6,5 +6,29 @@ "use strict"; | ||
exports.default = dedupe; | ||
var swcHelpers = require("@swc/helpers"); | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(n); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function dedupe(theArray) { | ||
return swcHelpers.toConsumableArray(new Set(theArray)); | ||
return _toConsumableArray(new Set(theArray)); | ||
} |
@@ -29,6 +29,10 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _chunk = swcHelpers.interopRequireDefault(require("./chunk")); | ||
var _createRange = swcHelpers.interopRequireDefault(require("./createRange")); | ||
var _createRangeWithStep = swcHelpers.interopRequireDefault(require("./createRangeWithStep")); | ||
var _dedupe = swcHelpers.interopRequireDefault(require("./dedupe")); | ||
var _chunk = _interopRequireDefault(require("./chunk")); | ||
var _createRange = _interopRequireDefault(require("./createRange")); | ||
var _createRangeWithStep = _interopRequireDefault(require("./createRangeWithStep")); | ||
var _dedupe = _interopRequireDefault(require("./dedupe")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
@@ -29,6 +29,10 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _removeRp = swcHelpers.interopRequireDefault(require("./removeRp")); | ||
var _removeThousandSeparator = swcHelpers.interopRequireDefault(require("./removeThousandSeparator")); | ||
var _toNumber = swcHelpers.interopRequireDefault(require("./toNumber")); | ||
var _toIDR = swcHelpers.interopRequireDefault(require("./toIDR")); | ||
var _removeRp = _interopRequireDefault(require("./removeRp")); | ||
var _removeThousandSeparator = _interopRequireDefault(require("./removeThousandSeparator")); | ||
var _toNumber = _interopRequireDefault(require("./toNumber")); | ||
var _toIDR = _interopRequireDefault(require("./toIDR")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
@@ -49,4 +49,3 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _constant = swcHelpers.interopRequireWildcard(require("./constant")); | ||
var _constant = _interopRequireWildcard(require("./constant")); | ||
Object.keys(_constant).forEach(function(key) { | ||
@@ -63,7 +62,33 @@ if (key === "default" || key === "__esModule") return; | ||
}); | ||
var _formatDay = swcHelpers.interopRequireDefault(require("./formatDay")); | ||
var _formatMonthTitle = swcHelpers.interopRequireDefault(require("./formatMonthTitle")); | ||
var _formatWeekdayLong = swcHelpers.interopRequireDefault(require("./formatWeekdayLong")); | ||
var _formatWeekdayShort = swcHelpers.interopRequireDefault(require("./formatWeekdayShort")); | ||
var _getFirstDayOfWeek = swcHelpers.interopRequireDefault(require("./getFirstDayOfWeek")); | ||
var _isValidDate = swcHelpers.interopRequireDefault(require("./isValidDate")); | ||
var _formatDay = _interopRequireDefault(require("./formatDay")); | ||
var _formatMonthTitle = _interopRequireDefault(require("./formatMonthTitle")); | ||
var _formatWeekdayLong = _interopRequireDefault(require("./formatWeekdayLong")); | ||
var _formatWeekdayShort = _interopRequireDefault(require("./formatWeekdayShort")); | ||
var _getFirstDayOfWeek = _interopRequireDefault(require("./getFirstDayOfWeek")); | ||
var _isValidDate = _interopRequireDefault(require("./isValidDate")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} | ||
function _interopRequireWildcard(obj) { | ||
if (obj && obj.__esModule) { | ||
return obj; | ||
} else { | ||
var newObj = {}; | ||
if (obj != null) { | ||
for(var key in obj){ | ||
if (Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; | ||
if (desc.get || desc.set) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
} | ||
newObj.default = obj; | ||
return newObj; | ||
} | ||
} |
@@ -6,6 +6,9 @@ "use strict"; | ||
exports.default = timestampFromNow; | ||
var swcHelpers = require("@swc/helpers"); | ||
var _typeof = function(obj) { | ||
"@swc/helpers - typeof"; | ||
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; | ||
}; | ||
function timestampFromNow(duration) { | ||
if (typeof duration !== 'number') { | ||
throw new TypeError("\"duration\" must be a number. Given: ".concat(duration, ". Type: ").concat(typeof duration === "undefined" ? "undefined" : swcHelpers.typeOf(duration))); | ||
throw new TypeError("\"duration\" must be a number. Given: ".concat(duration, ". Type: ").concat(typeof duration === "undefined" ? "undefined" : _typeof(duration))); | ||
} | ||
@@ -12,0 +15,0 @@ var mutableDate = new Date(); |
@@ -17,4 +17,8 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _canUseDOM = swcHelpers.interopRequireDefault(require("./canUseDOM")); | ||
var _isSafari = swcHelpers.interopRequireDefault(require("./isSafari")); | ||
var _canUseDOM = _interopRequireDefault(require("./canUseDOM")); | ||
var _isSafari = _interopRequireDefault(require("./isSafari")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
@@ -6,6 +6,10 @@ "use strict"; | ||
exports.default = void 0; | ||
var swcHelpers = require("@swc/helpers"); | ||
var _canUseDOM = swcHelpers.interopRequireDefault(require("./canUseDOM")); | ||
var _canUseDOM = _interopRequireDefault(require("./canUseDOM")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} | ||
var isSafari = _canUseDOM.default ? Boolean(typeof window.safari === 'object' && window.safari.pushNotification) : false; | ||
var _default = isSafari; | ||
exports.default = _default; |
@@ -6,4 +6,8 @@ "use strict"; | ||
exports.default = void 0; | ||
var swcHelpers = require("@swc/helpers"); | ||
var _flowRightJs = swcHelpers.interopRequireDefault(require("./flowRight.js")); | ||
var _flowRightJs = _interopRequireDefault(require("./flowRight.js")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} | ||
function compose() { | ||
@@ -10,0 +14,0 @@ for(var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++){ |
@@ -6,3 +6,27 @@ "use strict"; | ||
exports.debounce = debounce; | ||
var swcHelpers = require("@swc/helpers"); | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(n); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function debounce(fn, wait) { | ||
@@ -16,3 +40,3 @@ var timeout; | ||
timeout = setTimeout(function() { | ||
fn.apply(void 0, swcHelpers.toConsumableArray(arg)); | ||
fn.apply(void 0, _toConsumableArray(arg)); | ||
// eslint-disable-next-line testing-library/await-async-utils | ||
@@ -19,0 +43,0 @@ }, wait); |
@@ -6,3 +6,27 @@ "use strict"; | ||
exports.default = void 0; | ||
var swcHelpers = require("@swc/helpers"); | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(n); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
/** | ||
@@ -51,3 +75,3 @@ * Pushes a function call onto a list. The list of saved calls is executed after the surrounding function returns. | ||
]); | ||
result = fn.apply(void 0, swcHelpers.toConsumableArray(args)); | ||
result = fn.apply(void 0, _toConsumableArray(args)); | ||
if (!isPromise(result)) { | ||
@@ -54,0 +78,0 @@ result = resolve(result); |
@@ -6,4 +6,8 @@ "use strict"; | ||
exports.default = void 0; | ||
var swcHelpers = require("@swc/helpers"); | ||
var _flowJs = swcHelpers.interopRequireDefault(require("./flow.js")); | ||
var _flowJs = _interopRequireDefault(require("./flow.js")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} | ||
/** | ||
@@ -10,0 +14,0 @@ * This method is like `flow` except that it composes a function that |
@@ -47,9 +47,13 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _compose = swcHelpers.interopRequireDefault(require("./compose")); | ||
var _compose = _interopRequireDefault(require("./compose")); | ||
var _debounce = require("./debounce"); | ||
var _defer = swcHelpers.interopRequireDefault(require("./defer")); | ||
var _flow = swcHelpers.interopRequireDefault(require("./flow")); | ||
var _flowRight = swcHelpers.interopRequireDefault(require("./flowRight")); | ||
var _noop = swcHelpers.interopRequireDefault(require("./noop")); | ||
var _omit = swcHelpers.interopRequireDefault(require("./omit")); | ||
var _defer = _interopRequireDefault(require("./defer")); | ||
var _flow = _interopRequireDefault(require("./flow")); | ||
var _flowRight = _interopRequireDefault(require("./flowRight")); | ||
var _noop = _interopRequireDefault(require("./noop")); | ||
var _omit = _interopRequireDefault(require("./omit")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
@@ -6,3 +6,47 @@ "use strict"; | ||
exports.default = void 0; | ||
var swcHelpers = require("@swc/helpers"); | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for(i = 0; i < sourceSymbolKeys.length; i++){ | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for(i = 0; i < sourceKeys.length; i++){ | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
var _typeof = function(obj) { | ||
"@swc/helpers - typeof"; | ||
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; | ||
}; | ||
var _omit = function(o) { | ||
@@ -13,5 +57,5 @@ for(var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ | ||
return keys.reduce(function(memo, key) { | ||
var ignored = memo[key], rest = swcHelpers.objectWithoutProperties(memo, [ | ||
var ignored = memo[key], rest = _objectWithoutProperties(memo, [ | ||
key | ||
].map(swcHelpers.toPropertyKey)); | ||
].map(_toPropertyKey)); | ||
return rest; | ||
@@ -18,0 +62,0 @@ }, o); |
@@ -11,3 +11,7 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _safeParse = swcHelpers.interopRequireDefault(require("./safeParse")); | ||
var _safeParse = _interopRequireDefault(require("./safeParse")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
@@ -6,4 +6,8 @@ "use strict"; | ||
exports.default = void 0; | ||
var swcHelpers = require("@swc/helpers"); | ||
var _execIfFunc = swcHelpers.interopRequireDefault(require("./execIfFunc")); | ||
var _execIfFunc = _interopRequireDefault(require("./execIfFunc")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} | ||
/** | ||
@@ -10,0 +14,0 @@ * This is a higher order function that accepts a boolean condition and will |
@@ -23,5 +23,9 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _execIfFunc = swcHelpers.interopRequireDefault(require("./execIfFunc")); | ||
var _ifElse = swcHelpers.interopRequireDefault(require("./ifElse")); | ||
var _shallowEqual = swcHelpers.interopRequireDefault(require("./shallowEqual")); | ||
var _execIfFunc = _interopRequireDefault(require("./execIfFunc")); | ||
var _ifElse = _interopRequireDefault(require("./ifElse")); | ||
var _shallowEqual = _interopRequireDefault(require("./shallowEqual")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
@@ -23,5 +23,9 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _maskAddress = swcHelpers.interopRequireDefault(require("./maskAddress")); | ||
var _maskEmail = swcHelpers.interopRequireDefault(require("./maskEmail")); | ||
var _maskPhoneNumber = swcHelpers.interopRequireDefault(require("./maskPhoneNumber")); | ||
var _maskAddress = _interopRequireDefault(require("./maskAddress")); | ||
var _maskEmail = _interopRequireDefault(require("./maskEmail")); | ||
var _maskPhoneNumber = _interopRequireDefault(require("./maskPhoneNumber")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
@@ -59,11 +59,15 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _counterFormat = swcHelpers.interopRequireDefault(require("./counterFormat")); | ||
var _fileSizeFormat = swcHelpers.interopRequireDefault(require("./fileSizeFormat")); | ||
var _formatNumberUnified = swcHelpers.interopRequireDefault(require("./formatNumberUnified")); | ||
var _formatWeight = swcHelpers.interopRequireDefault(require("./formatWeight")); | ||
var _getRandomNumber = swcHelpers.interopRequireDefault(require("./getRandomNumber")); | ||
var _humanizeReviewCount = swcHelpers.interopRequireDefault(require("./humanizeReviewCount")); | ||
var _numberWithCommas = swcHelpers.interopRequireDefault(require("./numberWithCommas")); | ||
var _removeNonNumber = swcHelpers.interopRequireDefault(require("./removeNonNumber")); | ||
var _thousandSeparator = swcHelpers.interopRequireDefault(require("./thousandSeparator")); | ||
var _counterFormat = _interopRequireDefault(require("./counterFormat")); | ||
var _fileSizeFormat = _interopRequireDefault(require("./fileSizeFormat")); | ||
var _formatNumberUnified = _interopRequireDefault(require("./formatNumberUnified")); | ||
var _formatWeight = _interopRequireDefault(require("./formatWeight")); | ||
var _getRandomNumber = _interopRequireDefault(require("./getRandomNumber")); | ||
var _humanizeReviewCount = _interopRequireDefault(require("./humanizeReviewCount")); | ||
var _numberWithCommas = _interopRequireDefault(require("./numberWithCommas")); | ||
var _removeNonNumber = _interopRequireDefault(require("./removeNonNumber")); | ||
var _thousandSeparator = _interopRequireDefault(require("./thousandSeparator")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
@@ -59,11 +59,15 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _escapeRegExp = swcHelpers.interopRequireDefault(require("./escapeRegExp")); | ||
var _randomString = swcHelpers.interopRequireDefault(require("./randomString")); | ||
var _removeScriptTags = swcHelpers.interopRequireDefault(require("./removeScriptTags")); | ||
var _replaceDot = swcHelpers.interopRequireDefault(require("./replaceDot")); | ||
var _sanitizeLang = swcHelpers.interopRequireDefault(require("./sanitizeLang")); | ||
var _slugify = swcHelpers.interopRequireDefault(require("./slugify")); | ||
var _stringTemplate = swcHelpers.interopRequireDefault(require("./stringTemplate")); | ||
var _titleCase = swcHelpers.interopRequireDefault(require("./titleCase")); | ||
var _stringUnsafeHash = swcHelpers.interopRequireDefault(require("./stringUnsafeHash")); | ||
var _escapeRegExp = _interopRequireDefault(require("./escapeRegExp")); | ||
var _randomString = _interopRequireDefault(require("./randomString")); | ||
var _removeScriptTags = _interopRequireDefault(require("./removeScriptTags")); | ||
var _replaceDot = _interopRequireDefault(require("./replaceDot")); | ||
var _sanitizeLang = _interopRequireDefault(require("./sanitizeLang")); | ||
var _slugify = _interopRequireDefault(require("./slugify")); | ||
var _stringTemplate = _interopRequireDefault(require("./stringTemplate")); | ||
var _titleCase = _interopRequireDefault(require("./titleCase")); | ||
var _stringUnsafeHash = _interopRequireDefault(require("./stringUnsafeHash")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
@@ -6,3 +6,48 @@ "use strict"; | ||
exports.default = void 0; | ||
var swcHelpers = require("@swc/helpers"); | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithHoles(arr) { | ||
if (Array.isArray(arr)) return arr; | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; | ||
if (_i == null) return; | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _s, _e; | ||
try { | ||
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){ | ||
_arr.push(_s.value); | ||
if (i && _arr.length === i) break; | ||
} | ||
} catch (err) { | ||
_d = true; | ||
_e = err; | ||
} finally{ | ||
try { | ||
if (!_n && _i["return"] != null) _i["return"](); | ||
} finally{ | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(n); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
/** | ||
@@ -18,3 +63,3 @@ * Convert hex to rgba | ||
// eslint-disable-next-line prefer-const | ||
var ref = swcHelpers.slicedToArray(findColor.exec(hex) || [], 7), prefix = ref[1], hexColor = ref[2], r = ref[3], g = ref[4], b = ref[5], postfix = ref[6]; | ||
var ref = _slicedToArray(findColor.exec(hex) || [], 7), prefix = ref[1], hexColor = ref[2], r = ref[3], g = ref[4], b = ref[5], postfix = ref[6]; | ||
var isShortHand = (hexColor === null || hexColor === void 0 ? void 0 : hexColor.length) === 4; | ||
@@ -21,0 +66,0 @@ if (isShortHand) { |
@@ -17,4 +17,8 @@ "use strict"; | ||
}); | ||
var swcHelpers = require("@swc/helpers"); | ||
var _hexToRgba = swcHelpers.interopRequireDefault(require("./hexToRgba")); | ||
var _pxToRem = swcHelpers.interopRequireDefault(require("./pxToRem")); | ||
var _hexToRgba = _interopRequireDefault(require("./hexToRgba")); | ||
var _pxToRem = _interopRequireDefault(require("./pxToRem")); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} |
{ | ||
"name": "@lite-v3/common-helpers", | ||
"version": "0.0.14", | ||
"version": "0.1.0-alpha.1", | ||
"description": "Public common helpers for Tokopedia Web", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84682
2254