@tanwan/utils 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/addClass.cjs +19 -0
- package/dist/addClass.d.cts +16 -0
- package/dist/addClass.d.ts +17 -0
- package/dist/addClass.js +19 -0
- package/dist/{string/camelCase.d.cts → camelCase.d.cts} +1 -2
- package/dist/{string/camelCase.d.ts → camelCase.d.ts} +1 -2
- package/dist/{string/camelCase.js → camelCase.js} +0 -2
- package/dist/{string/capitalize.d.cts → capitalize.d.cts} +1 -2
- package/dist/{string/capitalize.d.ts → capitalize.d.ts} +1 -2
- package/dist/{string/capitalize.js → capitalize.js} +0 -2
- package/dist/{array/chunk.d.cts → chunk.d.cts} +1 -2
- package/dist/{array/chunk.d.ts → chunk.d.ts} +1 -2
- package/dist/{array/chunk.js → chunk.js} +0 -2
- package/dist/{number/clamp.d.cts → clamp.d.cts} +1 -2
- package/dist/{number/clamp.d.ts → clamp.d.ts} +1 -2
- package/dist/{number/clamp.js → clamp.js} +0 -2
- package/dist/convertCurrencyToChinese.cjs +56 -0
- package/dist/convertCurrencyToChinese.d.cts +18 -0
- package/dist/convertCurrencyToChinese.d.ts +19 -0
- package/dist/convertCurrencyToChinese.js +56 -0
- package/dist/copyToClipboard.cjs +38 -0
- package/dist/copyToClipboard.d.cts +17 -0
- package/dist/copyToClipboard.d.ts +18 -0
- package/dist/copyToClipboard.js +38 -0
- package/dist/createElement.cjs +27 -0
- package/dist/createElement.d.cts +21 -0
- package/dist/createElement.d.ts +22 -0
- package/dist/createElement.js +27 -0
- package/dist/{function/debounce.d.cts → debounce.d.cts} +1 -2
- package/dist/{function/debounce.d.ts → debounce.d.ts} +1 -2
- package/dist/{function/debounce.js → debounce.js} +0 -2
- package/dist/debounceSubmit.cjs +34 -0
- package/dist/debounceSubmit.d.cts +22 -0
- package/dist/debounceSubmit.d.ts +23 -0
- package/dist/debounceSubmit.js +34 -0
- package/dist/decodeBase64.cjs +19 -0
- package/dist/decodeBase64.d.cts +16 -0
- package/dist/decodeBase64.d.ts +17 -0
- package/dist/decodeBase64.js +19 -0
- package/dist/{base/deepClone.cjs → deepClone.cjs} +2 -2
- package/dist/{base/deepClone.d.cts → deepClone.d.cts} +1 -2
- package/dist/{base/deepClone.d.ts → deepClone.d.ts} +1 -2
- package/dist/{base/deepClone.js → deepClone.js} +0 -2
- package/dist/deepMerge.cjs +39 -0
- package/dist/deepMerge.d.cts +25 -0
- package/dist/deepMerge.d.ts +26 -0
- package/dist/deepMerge.js +39 -0
- package/dist/{function/delay.d.cts → delay.d.cts} +1 -2
- package/dist/{function/delay.d.ts → delay.d.ts} +1 -2
- package/dist/{function/delay.js → delay.js} +0 -2
- package/dist/difference.cjs +24 -0
- package/dist/difference.d.cts +20 -0
- package/dist/difference.d.ts +21 -0
- package/dist/difference.js +24 -0
- package/dist/downloadFile.cjs +31 -0
- package/dist/downloadFile.d.cts +20 -0
- package/dist/downloadFile.d.ts +21 -0
- package/dist/downloadFile.js +31 -0
- package/dist/encodeBase64.cjs +20 -0
- package/dist/encodeBase64.d.cts +17 -0
- package/dist/encodeBase64.d.ts +18 -0
- package/dist/encodeBase64.js +20 -0
- package/dist/{array/flatten.d.cts → flatten.d.cts} +1 -2
- package/dist/{array/flatten.d.ts → flatten.d.ts} +1 -2
- package/dist/{array/flatten.js → flatten.js} +0 -2
- package/dist/formatBankCard.cjs +19 -0
- package/dist/formatBankCard.d.cts +16 -0
- package/dist/formatBankCard.d.ts +17 -0
- package/dist/formatBankCard.js +19 -0
- package/dist/formatCurrency.cjs +7 -0
- package/dist/formatCurrency.d.cts +27 -0
- package/dist/formatCurrency.d.ts +28 -0
- package/dist/formatCurrency.js +7 -0
- package/dist/{date/formatDate.d.cts → formatDate.d.cts} +1 -2
- package/dist/{date/formatDate.d.ts → formatDate.d.ts} +1 -2
- package/dist/{date/formatDate.js → formatDate.js} +0 -2
- package/dist/formatFileSize.cjs +33 -0
- package/dist/formatFileSize.d.cts +19 -0
- package/dist/formatFileSize.d.ts +20 -0
- package/dist/formatFileSize.js +33 -0
- package/dist/formatIdCard.cjs +21 -0
- package/dist/formatIdCard.d.cts +17 -0
- package/dist/formatIdCard.d.ts +18 -0
- package/dist/formatIdCard.js +21 -0
- package/dist/formatPhone.cjs +21 -0
- package/dist/formatPhone.d.cts +17 -0
- package/dist/formatPhone.d.ts +18 -0
- package/dist/formatPhone.js +21 -0
- package/dist/{number/formatThousands.d.cts → formatThousands.d.cts} +1 -2
- package/dist/{number/formatThousands.d.ts → formatThousands.d.ts} +1 -2
- package/dist/{number/formatThousands.js → formatThousands.js} +0 -2
- package/dist/generateCode.cjs +29 -0
- package/dist/generateCode.d.cts +19 -0
- package/dist/generateCode.d.ts +20 -0
- package/dist/generateCode.js +29 -0
- package/dist/getAge.cjs +30 -0
- package/dist/getAge.d.cts +18 -0
- package/dist/getAge.d.ts +19 -0
- package/dist/getAge.js +30 -0
- package/dist/getByPath.cjs +29 -0
- package/dist/getByPath.d.cts +20 -0
- package/dist/getByPath.d.ts +21 -0
- package/dist/getByPath.js +29 -0
- package/dist/getCssVar.cjs +22 -0
- package/dist/getCssVar.d.cts +18 -0
- package/dist/getCssVar.d.ts +19 -0
- package/dist/getCssVar.js +22 -0
- package/dist/{date/getRelativeTime.d.cts → getRelativeTime.d.cts} +1 -2
- package/dist/{date/getRelativeTime.d.ts → getRelativeTime.d.ts} +1 -2
- package/dist/{date/getRelativeTime.js → getRelativeTime.js} +0 -2
- package/dist/getScrollTop.cjs +28 -0
- package/dist/getScrollTop.d.cts +18 -0
- package/dist/getScrollTop.d.ts +19 -0
- package/dist/getScrollTop.js +28 -0
- package/dist/getStorage.cjs +27 -0
- package/dist/getStorage.d.cts +18 -0
- package/dist/getStorage.d.ts +19 -0
- package/dist/getStorage.js +27 -0
- package/dist/getStyle.cjs +20 -0
- package/dist/getStyle.d.cts +17 -0
- package/dist/getStyle.d.ts +18 -0
- package/dist/getStyle.js +20 -0
- package/dist/getTextWidth.cjs +26 -0
- package/dist/getTextWidth.d.cts +16 -0
- package/dist/getTextWidth.d.ts +17 -0
- package/dist/getTextWidth.js +26 -0
- package/dist/{array/groupBy.d.cts → groupBy.d.cts} +1 -2
- package/dist/{array/groupBy.d.ts → groupBy.d.ts} +1 -2
- package/dist/{array/groupBy.js → groupBy.js} +0 -2
- package/dist/hasClass.cjs +19 -0
- package/dist/hasClass.d.cts +16 -0
- package/dist/hasClass.d.ts +17 -0
- package/dist/hasClass.js +19 -0
- package/dist/index.cjs +180 -54
- package/dist/index.d.cts +91 -28
- package/dist/index.d.ts +91 -28
- package/dist/index.iife.js +1 -1
- package/dist/index.js +91 -28
- package/dist/insertAfter.cjs +19 -0
- package/dist/insertAfter.d.cts +15 -0
- package/dist/insertAfter.d.ts +16 -0
- package/dist/insertAfter.js +19 -0
- package/dist/intersection.cjs +24 -0
- package/dist/intersection.d.cts +20 -0
- package/dist/intersection.d.ts +21 -0
- package/dist/intersection.js +24 -0
- package/dist/invert.cjs +21 -0
- package/dist/invert.d.cts +16 -0
- package/dist/invert.d.ts +17 -0
- package/dist/invert.js +21 -0
- package/dist/{base/isArray.d.cts → isArray.d.cts} +1 -2
- package/dist/{base/isArray.d.ts → isArray.d.ts} +1 -2
- package/dist/{base/isArray.js → isArray.js} +0 -2
- package/dist/isBrowser.cjs +17 -0
- package/dist/isBrowser.d.cts +14 -0
- package/dist/isBrowser.d.ts +15 -0
- package/dist/isBrowser.js +17 -0
- package/dist/isDate.cjs +18 -0
- package/dist/isDate.d.cts +15 -0
- package/dist/isDate.d.ts +16 -0
- package/dist/isDate.js +18 -0
- package/dist/{base/isEmpty.cjs → isEmpty.cjs} +2 -2
- package/dist/{base/isEmpty.d.cts → isEmpty.d.cts} +1 -2
- package/dist/{base/isEmpty.d.ts → isEmpty.d.ts} +1 -2
- package/dist/{base/isEmpty.js → isEmpty.js} +0 -2
- package/dist/isFunction.cjs +19 -0
- package/dist/isFunction.d.cts +16 -0
- package/dist/isFunction.d.ts +17 -0
- package/dist/isFunction.js +19 -0
- package/dist/isInViewport.cjs +22 -0
- package/dist/isInViewport.d.cts +17 -0
- package/dist/isInViewport.d.ts +18 -0
- package/dist/isInViewport.js +22 -0
- package/dist/isNil.cjs +19 -0
- package/dist/isNil.d.cts +16 -0
- package/dist/isNil.d.ts +17 -0
- package/dist/isNil.js +19 -0
- package/dist/isNumber.cjs +19 -0
- package/dist/isNumber.d.cts +16 -0
- package/dist/isNumber.d.ts +17 -0
- package/dist/isNumber.js +19 -0
- package/dist/{base/isObject.d.cts → isObject.d.cts} +1 -2
- package/dist/{base/isObject.d.ts → isObject.d.ts} +1 -2
- package/dist/{base/isObject.js → isObject.js} +0 -2
- package/dist/isPrimitive.cjs +21 -0
- package/dist/isPrimitive.d.cts +18 -0
- package/dist/isPrimitive.d.ts +19 -0
- package/dist/isPrimitive.js +21 -0
- package/dist/isPromise.cjs +18 -0
- package/dist/isPromise.d.cts +15 -0
- package/dist/isPromise.d.ts +16 -0
- package/dist/isPromise.js +18 -0
- package/dist/{base/isString.d.cts → isString.d.cts} +1 -2
- package/dist/{base/isString.d.ts → isString.d.ts} +1 -2
- package/dist/{base/isString.js → isString.js} +0 -2
- package/dist/joinUrl.cjs +25 -0
- package/dist/joinUrl.d.cts +19 -0
- package/dist/joinUrl.d.ts +20 -0
- package/dist/joinUrl.js +25 -0
- package/dist/{string/kebabCase.d.cts → kebabCase.d.cts} +1 -2
- package/dist/{string/kebabCase.d.ts → kebabCase.d.ts} +1 -2
- package/dist/{string/kebabCase.js → kebabCase.js} +0 -2
- package/dist/lazyLoadImages.cjs +36 -0
- package/dist/lazyLoadImages.d.cts +19 -0
- package/dist/lazyLoadImages.d.ts +20 -0
- package/dist/lazyLoadImages.js +36 -0
- package/dist/listToTree.cjs +25 -0
- package/dist/listToTree.d.cts +32 -0
- package/dist/listToTree.d.ts +33 -0
- package/dist/listToTree.js +25 -0
- package/dist/mapValues.cjs +25 -0
- package/dist/mapValues.d.cts +20 -0
- package/dist/mapValues.d.ts +21 -0
- package/dist/mapValues.js +25 -0
- package/dist/maskString.cjs +28 -0
- package/dist/maskString.d.cts +24 -0
- package/dist/maskString.d.ts +25 -0
- package/dist/maskString.js +28 -0
- package/dist/memoize.cjs +32 -0
- package/dist/memoize.d.cts +22 -0
- package/dist/memoize.d.ts +23 -0
- package/dist/memoize.js +32 -0
- package/dist/off.cjs +22 -0
- package/dist/off.d.cts +19 -0
- package/dist/off.d.ts +20 -0
- package/dist/off.js +22 -0
- package/dist/{object/omit.d.cts → omit.d.cts} +1 -2
- package/dist/{object/omit.d.ts → omit.d.ts} +1 -2
- package/dist/{object/omit.js → omit.js} +0 -2
- package/dist/on.cjs +21 -0
- package/dist/on.d.cts +18 -0
- package/dist/on.d.ts +19 -0
- package/dist/on.js +21 -0
- package/dist/once.cjs +31 -0
- package/dist/once.d.cts +20 -0
- package/dist/once.d.ts +21 -0
- package/dist/once.js +31 -0
- package/dist/{url/parseQueryString.d.cts → parseQueryString.d.cts} +1 -2
- package/dist/{url/parseQueryString.d.ts → parseQueryString.d.ts} +1 -2
- package/dist/{url/parseQueryString.js → parseQueryString.js} +0 -2
- package/dist/pascalCase.cjs +18 -0
- package/dist/pascalCase.d.cts +15 -0
- package/dist/pascalCase.d.ts +16 -0
- package/dist/pascalCase.js +18 -0
- package/dist/{object/pick.d.cts → pick.d.cts} +1 -2
- package/dist/{object/pick.d.ts → pick.d.ts} +1 -2
- package/dist/{object/pick.js → pick.js} +0 -2
- package/dist/{number/randomInt.d.cts → randomInt.d.cts} +1 -2
- package/dist/{number/randomInt.d.ts → randomInt.d.ts} +1 -2
- package/dist/{number/randomInt.js → randomInt.js} +0 -2
- package/dist/{array/range.d.cts → range.d.cts} +1 -2
- package/dist/{array/range.d.ts → range.d.ts} +1 -2
- package/dist/{array/range.js → range.js} +0 -2
- package/dist/removeClass.cjs +19 -0
- package/dist/removeClass.d.cts +16 -0
- package/dist/removeClass.d.ts +17 -0
- package/dist/removeClass.js +19 -0
- package/dist/removeElement.cjs +17 -0
- package/dist/removeElement.d.cts +14 -0
- package/dist/removeElement.d.ts +15 -0
- package/dist/removeElement.js +17 -0
- package/dist/removeStorage.cjs +19 -0
- package/dist/removeStorage.d.cts +14 -0
- package/dist/removeStorage.d.ts +15 -0
- package/dist/removeStorage.js +19 -0
- package/dist/retry.cjs +27 -0
- package/dist/retry.d.cts +17 -0
- package/dist/retry.d.ts +18 -0
- package/dist/retry.js +27 -0
- package/dist/sample.cjs +20 -0
- package/dist/sample.d.cts +16 -0
- package/dist/sample.d.ts +17 -0
- package/dist/sample.js +20 -0
- package/dist/scrollToElement.cjs +23 -0
- package/dist/scrollToElement.d.cts +16 -0
- package/dist/scrollToElement.d.ts +17 -0
- package/dist/scrollToElement.js +23 -0
- package/dist/setCssVar.cjs +22 -0
- package/dist/setCssVar.d.cts +18 -0
- package/dist/setCssVar.d.ts +19 -0
- package/dist/setCssVar.js +22 -0
- package/dist/setStorage.cjs +25 -0
- package/dist/setStorage.d.cts +17 -0
- package/dist/setStorage.d.ts +18 -0
- package/dist/setStorage.js +25 -0
- package/dist/setStyle.cjs +22 -0
- package/dist/setStyle.d.cts +19 -0
- package/dist/setStyle.d.ts +20 -0
- package/dist/setStyle.js +22 -0
- package/dist/{array/shuffle.d.cts → shuffle.d.cts} +1 -2
- package/dist/{array/shuffle.d.ts → shuffle.d.ts} +1 -2
- package/dist/{array/shuffle.js → shuffle.js} +0 -2
- package/dist/snakeCase.cjs +18 -0
- package/dist/snakeCase.d.cts +15 -0
- package/dist/snakeCase.d.ts +16 -0
- package/dist/snakeCase.js +18 -0
- package/dist/sortBy.cjs +30 -0
- package/dist/sortBy.d.cts +20 -0
- package/dist/sortBy.d.ts +21 -0
- package/dist/sortBy.js +30 -0
- package/dist/{url/stringifyQueryString.d.cts → stringifyQueryString.d.cts} +1 -2
- package/dist/{url/stringifyQueryString.d.ts → stringifyQueryString.d.ts} +1 -2
- package/dist/{url/stringifyQueryString.js → stringifyQueryString.js} +0 -2
- package/dist/{function/throttle.d.cts → throttle.d.cts} +1 -2
- package/dist/{function/throttle.d.ts → throttle.d.ts} +1 -2
- package/dist/{function/throttle.js → throttle.js} +0 -2
- package/dist/toggleClass.cjs +22 -0
- package/dist/toggleClass.d.cts +19 -0
- package/dist/toggleClass.d.ts +20 -0
- package/dist/toggleClass.js +22 -0
- package/dist/treeFind.cjs +34 -0
- package/dist/treeFind.d.cts +25 -0
- package/dist/treeFind.d.ts +26 -0
- package/dist/treeFind.js +34 -0
- package/dist/treeToList.cjs +33 -0
- package/dist/treeToList.d.cts +24 -0
- package/dist/treeToList.d.ts +25 -0
- package/dist/treeToList.js +33 -0
- package/dist/truncate.cjs +23 -0
- package/dist/truncate.d.cts +19 -0
- package/dist/truncate.d.ts +20 -0
- package/dist/truncate.js +23 -0
- package/dist/uniqBy.cjs +30 -0
- package/dist/uniqBy.d.cts +20 -0
- package/dist/uniqBy.d.ts +21 -0
- package/dist/uniqBy.js +30 -0
- package/dist/{array/unique.d.cts → unique.d.cts} +1 -2
- package/dist/{array/unique.d.ts → unique.d.ts} +1 -2
- package/dist/{array/unique.js → unique.js} +0 -2
- package/dist/{string/uuid.d.cts → uuid.d.cts} +1 -2
- package/dist/{string/uuid.d.ts → uuid.d.ts} +1 -2
- package/dist/{string/uuid.js → uuid.js} +0 -2
- package/dist/validateEmail.cjs +19 -0
- package/dist/validateEmail.d.cts +16 -0
- package/dist/validateEmail.d.ts +17 -0
- package/dist/validateEmail.js +19 -0
- package/dist/validateIdCard.cjs +62 -0
- package/dist/validateIdCard.d.cts +15 -0
- package/dist/validateIdCard.d.ts +16 -0
- package/dist/validateIdCard.js +62 -0
- package/dist/validatePhone.cjs +19 -0
- package/dist/validatePhone.d.cts +16 -0
- package/dist/validatePhone.d.ts +17 -0
- package/dist/validatePhone.js +19 -0
- package/package.json +340 -83
- package/dist/array/chunk.d.cts.map +0 -1
- package/dist/array/chunk.d.ts.map +0 -1
- package/dist/array/chunk.js.map +0 -1
- package/dist/array/flatten.d.cts.map +0 -1
- package/dist/array/flatten.d.ts.map +0 -1
- package/dist/array/flatten.js.map +0 -1
- package/dist/array/groupBy.d.cts.map +0 -1
- package/dist/array/groupBy.d.ts.map +0 -1
- package/dist/array/groupBy.js.map +0 -1
- package/dist/array/range.d.cts.map +0 -1
- package/dist/array/range.d.ts.map +0 -1
- package/dist/array/range.js.map +0 -1
- package/dist/array/shuffle.d.cts.map +0 -1
- package/dist/array/shuffle.d.ts.map +0 -1
- package/dist/array/shuffle.js.map +0 -1
- package/dist/array/unique.d.cts.map +0 -1
- package/dist/array/unique.d.ts.map +0 -1
- package/dist/array/unique.js.map +0 -1
- package/dist/base/deepClone.d.cts.map +0 -1
- package/dist/base/deepClone.d.ts.map +0 -1
- package/dist/base/deepClone.js.map +0 -1
- package/dist/base/isArray.d.cts.map +0 -1
- package/dist/base/isArray.d.ts.map +0 -1
- package/dist/base/isArray.js.map +0 -1
- package/dist/base/isEmpty.d.cts.map +0 -1
- package/dist/base/isEmpty.d.ts.map +0 -1
- package/dist/base/isEmpty.js.map +0 -1
- package/dist/base/isObject.d.cts.map +0 -1
- package/dist/base/isObject.d.ts.map +0 -1
- package/dist/base/isObject.js.map +0 -1
- package/dist/base/isString.d.cts.map +0 -1
- package/dist/base/isString.d.ts.map +0 -1
- package/dist/base/isString.js.map +0 -1
- package/dist/date/formatDate.d.cts.map +0 -1
- package/dist/date/formatDate.d.ts.map +0 -1
- package/dist/date/formatDate.js.map +0 -1
- package/dist/date/getRelativeTime.d.cts.map +0 -1
- package/dist/date/getRelativeTime.d.ts.map +0 -1
- package/dist/date/getRelativeTime.js.map +0 -1
- package/dist/function/debounce.d.cts.map +0 -1
- package/dist/function/debounce.d.ts.map +0 -1
- package/dist/function/debounce.js.map +0 -1
- package/dist/function/delay.d.cts.map +0 -1
- package/dist/function/delay.d.ts.map +0 -1
- package/dist/function/delay.js.map +0 -1
- package/dist/function/throttle.d.cts.map +0 -1
- package/dist/function/throttle.d.ts.map +0 -1
- package/dist/function/throttle.js.map +0 -1
- package/dist/number/clamp.d.cts.map +0 -1
- package/dist/number/clamp.d.ts.map +0 -1
- package/dist/number/clamp.js.map +0 -1
- package/dist/number/formatThousands.d.cts.map +0 -1
- package/dist/number/formatThousands.d.ts.map +0 -1
- package/dist/number/formatThousands.js.map +0 -1
- package/dist/number/randomInt.d.cts.map +0 -1
- package/dist/number/randomInt.d.ts.map +0 -1
- package/dist/number/randomInt.js.map +0 -1
- package/dist/object/omit.d.cts.map +0 -1
- package/dist/object/omit.d.ts.map +0 -1
- package/dist/object/omit.js.map +0 -1
- package/dist/object/pick.d.cts.map +0 -1
- package/dist/object/pick.d.ts.map +0 -1
- package/dist/object/pick.js.map +0 -1
- package/dist/string/camelCase.d.cts.map +0 -1
- package/dist/string/camelCase.d.ts.map +0 -1
- package/dist/string/camelCase.js.map +0 -1
- package/dist/string/capitalize.d.cts.map +0 -1
- package/dist/string/capitalize.d.ts.map +0 -1
- package/dist/string/capitalize.js.map +0 -1
- package/dist/string/kebabCase.d.cts.map +0 -1
- package/dist/string/kebabCase.d.ts.map +0 -1
- package/dist/string/kebabCase.js.map +0 -1
- package/dist/string/uuid.d.cts.map +0 -1
- package/dist/string/uuid.d.ts.map +0 -1
- package/dist/string/uuid.js.map +0 -1
- package/dist/url/parseQueryString.d.cts.map +0 -1
- package/dist/url/parseQueryString.d.ts.map +0 -1
- package/dist/url/parseQueryString.js.map +0 -1
- package/dist/url/stringifyQueryString.d.cts.map +0 -1
- package/dist/url/stringifyQueryString.d.ts.map +0 -1
- package/dist/url/stringifyQueryString.js.map +0 -1
- /package/dist/{string/camelCase.cjs → camelCase.cjs} +0 -0
- /package/dist/{string/capitalize.cjs → capitalize.cjs} +0 -0
- /package/dist/{array/chunk.cjs → chunk.cjs} +0 -0
- /package/dist/{number/clamp.cjs → clamp.cjs} +0 -0
- /package/dist/{function/debounce.cjs → debounce.cjs} +0 -0
- /package/dist/{function/delay.cjs → delay.cjs} +0 -0
- /package/dist/{array/flatten.cjs → flatten.cjs} +0 -0
- /package/dist/{date/formatDate.cjs → formatDate.cjs} +0 -0
- /package/dist/{number/formatThousands.cjs → formatThousands.cjs} +0 -0
- /package/dist/{date/getRelativeTime.cjs → getRelativeTime.cjs} +0 -0
- /package/dist/{array/groupBy.cjs → groupBy.cjs} +0 -0
- /package/dist/{base/isArray.cjs → isArray.cjs} +0 -0
- /package/dist/{base/isObject.cjs → isObject.cjs} +0 -0
- /package/dist/{base/isString.cjs → isString.cjs} +0 -0
- /package/dist/{string/kebabCase.cjs → kebabCase.cjs} +0 -0
- /package/dist/{object/omit.cjs → omit.cjs} +0 -0
- /package/dist/{url/parseQueryString.cjs → parseQueryString.cjs} +0 -0
- /package/dist/{object/pick.cjs → pick.cjs} +0 -0
- /package/dist/{number/randomInt.cjs → randomInt.cjs} +0 -0
- /package/dist/{array/range.cjs → range.cjs} +0 -0
- /package/dist/{array/shuffle.cjs → shuffle.cjs} +0 -0
- /package/dist/{url/stringifyQueryString.cjs → stringifyQueryString.cjs} +0 -0
- /package/dist/{function/throttle.cjs → throttle.cjs} +0 -0
- /package/dist/{array/unique.cjs → unique.cjs} +0 -0
- /package/dist/{string/uuid.cjs → uuid.cjs} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,55 +1,181 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
2
|
+
const require_isArray = require("./isArray.cjs");
|
|
3
|
+
const require_isString = require("./isString.cjs");
|
|
4
|
+
const require_isObject = require("./isObject.cjs");
|
|
5
|
+
const require_deepClone = require("./deepClone.cjs");
|
|
6
|
+
const require_isEmpty = require("./isEmpty.cjs");
|
|
7
|
+
const require_isNil = require("./isNil.cjs");
|
|
8
|
+
const require_isNumber = require("./isNumber.cjs");
|
|
9
|
+
const require_isFunction = require("./isFunction.cjs");
|
|
10
|
+
const require_isPromise = require("./isPromise.cjs");
|
|
11
|
+
const require_isPrimitive = require("./isPrimitive.cjs");
|
|
12
|
+
const require_isBrowser = require("./isBrowser.cjs");
|
|
13
|
+
const require_pick = require("./pick.cjs");
|
|
14
|
+
const require_omit = require("./omit.cjs");
|
|
15
|
+
const require_deepMerge = require("./deepMerge.cjs");
|
|
16
|
+
const require_getByPath = require("./getByPath.cjs");
|
|
17
|
+
const require_mapValues = require("./mapValues.cjs");
|
|
18
|
+
const require_invert = require("./invert.cjs");
|
|
19
|
+
const require_debounce = require("./debounce.cjs");
|
|
20
|
+
const require_throttle = require("./throttle.cjs");
|
|
21
|
+
const require_delay = require("./delay.cjs");
|
|
22
|
+
const require_once = require("./once.cjs");
|
|
23
|
+
const require_memoize = require("./memoize.cjs");
|
|
24
|
+
const require_unique = require("./unique.cjs");
|
|
25
|
+
const require_flatten = require("./flatten.cjs");
|
|
26
|
+
const require_chunk = require("./chunk.cjs");
|
|
27
|
+
const require_range = require("./range.cjs");
|
|
28
|
+
const require_groupBy = require("./groupBy.cjs");
|
|
29
|
+
const require_sortBy = require("./sortBy.cjs");
|
|
30
|
+
const require_difference = require("./difference.cjs");
|
|
31
|
+
const require_intersection = require("./intersection.cjs");
|
|
32
|
+
const require_uniqBy = require("./uniqBy.cjs");
|
|
33
|
+
const require_sample = require("./sample.cjs");
|
|
34
|
+
const require_randomInt = require("./randomInt.cjs");
|
|
35
|
+
const require_clamp = require("./clamp.cjs");
|
|
36
|
+
const require_formatThousands = require("./formatThousands.cjs");
|
|
37
|
+
const require_formatDate = require("./formatDate.cjs");
|
|
38
|
+
const require_getRelativeTime = require("./getRelativeTime.cjs");
|
|
39
|
+
const require_isDate = require("./isDate.cjs");
|
|
40
|
+
const require_camelCase = require("./camelCase.cjs");
|
|
41
|
+
const require_kebabCase = require("./kebabCase.cjs");
|
|
42
|
+
const require_capitalize = require("./capitalize.cjs");
|
|
43
|
+
const require_uuid = require("./uuid.cjs");
|
|
44
|
+
const require_snakeCase = require("./snakeCase.cjs");
|
|
45
|
+
const require_pascalCase = require("./pascalCase.cjs");
|
|
46
|
+
const require_truncate = require("./truncate.cjs");
|
|
47
|
+
const require_maskString = require("./maskString.cjs");
|
|
48
|
+
const require_parseQueryString = require("./parseQueryString.cjs");
|
|
49
|
+
const require_stringifyQueryString = require("./stringifyQueryString.cjs");
|
|
50
|
+
const require_joinUrl = require("./joinUrl.cjs");
|
|
51
|
+
const require_listToTree = require("./listToTree.cjs");
|
|
52
|
+
const require_treeToList = require("./treeToList.cjs");
|
|
53
|
+
const require_treeFind = require("./treeFind.cjs");
|
|
54
|
+
const require_getStorage = require("./getStorage.cjs");
|
|
55
|
+
const require_setStorage = require("./setStorage.cjs");
|
|
56
|
+
const require_removeStorage = require("./removeStorage.cjs");
|
|
57
|
+
const require_formatCurrency = require("./formatCurrency.cjs");
|
|
58
|
+
const require_formatFileSize = require("./formatFileSize.cjs");
|
|
59
|
+
const require_copyToClipboard = require("./copyToClipboard.cjs");
|
|
60
|
+
const require_downloadFile = require("./downloadFile.cjs");
|
|
61
|
+
const require_formatPhone = require("./formatPhone.cjs");
|
|
62
|
+
const require_formatIdCard = require("./formatIdCard.cjs");
|
|
63
|
+
const require_formatBankCard = require("./formatBankCard.cjs");
|
|
64
|
+
const require_validatePhone = require("./validatePhone.cjs");
|
|
65
|
+
const require_validateEmail = require("./validateEmail.cjs");
|
|
66
|
+
const require_validateIdCard = require("./validateIdCard.cjs");
|
|
67
|
+
const require_retry = require("./retry.cjs");
|
|
68
|
+
const require_generateCode = require("./generateCode.cjs");
|
|
69
|
+
const require_convertCurrencyToChinese = require("./convertCurrencyToChinese.cjs");
|
|
70
|
+
const require_debounceSubmit = require("./debounceSubmit.cjs");
|
|
71
|
+
const require_getAge = require("./getAge.cjs");
|
|
72
|
+
const require_encodeBase64 = require("./encodeBase64.cjs");
|
|
73
|
+
const require_decodeBase64 = require("./decodeBase64.cjs");
|
|
74
|
+
const require_hasClass = require("./hasClass.cjs");
|
|
75
|
+
const require_addClass = require("./addClass.cjs");
|
|
76
|
+
const require_removeClass = require("./removeClass.cjs");
|
|
77
|
+
const require_toggleClass = require("./toggleClass.cjs");
|
|
78
|
+
const require_getStyle = require("./getStyle.cjs");
|
|
79
|
+
const require_setStyle = require("./setStyle.cjs");
|
|
80
|
+
const require_on = require("./on.cjs");
|
|
81
|
+
const require_off = require("./off.cjs");
|
|
82
|
+
const require_getScrollTop = require("./getScrollTop.cjs");
|
|
83
|
+
const require_isInViewport = require("./isInViewport.cjs");
|
|
84
|
+
const require_createElement = require("./createElement.cjs");
|
|
85
|
+
const require_insertAfter = require("./insertAfter.cjs");
|
|
86
|
+
const require_removeElement = require("./removeElement.cjs");
|
|
87
|
+
const require_scrollToElement = require("./scrollToElement.cjs");
|
|
88
|
+
const require_getCssVar = require("./getCssVar.cjs");
|
|
89
|
+
const require_setCssVar = require("./setCssVar.cjs");
|
|
90
|
+
const require_getTextWidth = require("./getTextWidth.cjs");
|
|
91
|
+
const require_lazyLoadImages = require("./lazyLoadImages.cjs");
|
|
92
|
+
exports.addClass = require_addClass;
|
|
93
|
+
exports.camelCase = require_camelCase;
|
|
94
|
+
exports.capitalize = require_capitalize;
|
|
95
|
+
exports.chunk = require_chunk;
|
|
96
|
+
exports.clamp = require_clamp;
|
|
97
|
+
exports.convertCurrencyToChinese = require_convertCurrencyToChinese;
|
|
98
|
+
exports.copyToClipboard = require_copyToClipboard;
|
|
99
|
+
exports.createElement = require_createElement;
|
|
100
|
+
exports.debounce = require_debounce;
|
|
101
|
+
exports.debounceSubmit = require_debounceSubmit;
|
|
102
|
+
exports.decodeBase64 = require_decodeBase64;
|
|
103
|
+
exports.deepClone = require_deepClone;
|
|
104
|
+
exports.deepMerge = require_deepMerge;
|
|
105
|
+
exports.delay = require_delay;
|
|
106
|
+
exports.difference = require_difference;
|
|
107
|
+
exports.downloadFile = require_downloadFile;
|
|
108
|
+
exports.encodeBase64 = require_encodeBase64;
|
|
109
|
+
exports.flatten = require_flatten;
|
|
110
|
+
exports.formatBankCard = require_formatBankCard;
|
|
111
|
+
exports.formatCurrency = require_formatCurrency;
|
|
112
|
+
exports.formatDate = require_formatDate;
|
|
113
|
+
exports.formatFileSize = require_formatFileSize;
|
|
114
|
+
exports.formatIdCard = require_formatIdCard;
|
|
115
|
+
exports.formatPhone = require_formatPhone;
|
|
116
|
+
exports.formatThousands = require_formatThousands;
|
|
117
|
+
exports.generateCode = require_generateCode;
|
|
118
|
+
exports.getAge = require_getAge;
|
|
119
|
+
exports.getByPath = require_getByPath;
|
|
120
|
+
exports.getCssVar = require_getCssVar;
|
|
121
|
+
exports.getRelativeTime = require_getRelativeTime;
|
|
122
|
+
exports.getScrollTop = require_getScrollTop;
|
|
123
|
+
exports.getStorage = require_getStorage;
|
|
124
|
+
exports.getStyle = require_getStyle;
|
|
125
|
+
exports.getTextWidth = require_getTextWidth;
|
|
126
|
+
exports.groupBy = require_groupBy;
|
|
127
|
+
exports.hasClass = require_hasClass;
|
|
128
|
+
exports.insertAfter = require_insertAfter;
|
|
129
|
+
exports.intersection = require_intersection;
|
|
130
|
+
exports.invert = require_invert;
|
|
131
|
+
exports.isArray = require_isArray;
|
|
132
|
+
exports.isBrowser = require_isBrowser;
|
|
133
|
+
exports.isDate = require_isDate;
|
|
134
|
+
exports.isEmpty = require_isEmpty;
|
|
135
|
+
exports.isFunction = require_isFunction;
|
|
136
|
+
exports.isInViewport = require_isInViewport;
|
|
137
|
+
exports.isNil = require_isNil;
|
|
138
|
+
exports.isNumber = require_isNumber;
|
|
139
|
+
exports.isObject = require_isObject;
|
|
140
|
+
exports.isPrimitive = require_isPrimitive;
|
|
141
|
+
exports.isPromise = require_isPromise;
|
|
142
|
+
exports.isString = require_isString;
|
|
143
|
+
exports.joinUrl = require_joinUrl;
|
|
144
|
+
exports.kebabCase = require_kebabCase;
|
|
145
|
+
exports.lazyLoadImages = require_lazyLoadImages;
|
|
146
|
+
exports.listToTree = require_listToTree;
|
|
147
|
+
exports.mapValues = require_mapValues;
|
|
148
|
+
exports.maskString = require_maskString;
|
|
149
|
+
exports.memoize = require_memoize;
|
|
150
|
+
exports.off = require_off;
|
|
151
|
+
exports.omit = require_omit;
|
|
152
|
+
exports.on = require_on;
|
|
153
|
+
exports.once = require_once;
|
|
154
|
+
exports.parseQueryString = require_parseQueryString;
|
|
155
|
+
exports.pascalCase = require_pascalCase;
|
|
156
|
+
exports.pick = require_pick;
|
|
157
|
+
exports.randomInt = require_randomInt;
|
|
158
|
+
exports.range = require_range;
|
|
159
|
+
exports.removeClass = require_removeClass;
|
|
160
|
+
exports.removeElement = require_removeElement;
|
|
161
|
+
exports.removeStorage = require_removeStorage;
|
|
162
|
+
exports.retry = require_retry;
|
|
163
|
+
exports.sample = require_sample;
|
|
164
|
+
exports.scrollToElement = require_scrollToElement;
|
|
165
|
+
exports.setCssVar = require_setCssVar;
|
|
166
|
+
exports.setStorage = require_setStorage;
|
|
167
|
+
exports.setStyle = require_setStyle;
|
|
168
|
+
exports.snakeCase = require_snakeCase;
|
|
169
|
+
exports.sortBy = require_sortBy;
|
|
170
|
+
exports.stringifyQueryString = require_stringifyQueryString;
|
|
171
|
+
exports.throttle = require_throttle;
|
|
172
|
+
exports.toggleClass = require_toggleClass;
|
|
173
|
+
exports.treeFind = require_treeFind;
|
|
174
|
+
exports.treeToList = require_treeToList;
|
|
175
|
+
exports.truncate = require_truncate;
|
|
176
|
+
exports.uniqBy = require_uniqBy;
|
|
177
|
+
exports.unique = require_unique;
|
|
178
|
+
exports.uuid = require_uuid;
|
|
179
|
+
exports.validateEmail = require_validateEmail;
|
|
180
|
+
exports.validateIdCard = require_validateIdCard;
|
|
181
|
+
exports.validatePhone = require_validatePhone;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,28 +1,91 @@
|
|
|
1
|
-
import chunk from "./
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
|
|
1
|
+
import chunk from "./chunk.cjs";
|
|
2
|
+
import difference from "./difference.cjs";
|
|
3
|
+
import flatten from "./flatten.cjs";
|
|
4
|
+
import groupBy from "./groupBy.cjs";
|
|
5
|
+
import intersection from "./intersection.cjs";
|
|
6
|
+
import range from "./range.cjs";
|
|
7
|
+
import sample from "./sample.cjs";
|
|
8
|
+
import sortBy from "./sortBy.cjs";
|
|
9
|
+
import uniqBy from "./uniqBy.cjs";
|
|
10
|
+
import unique from "./unique.cjs";
|
|
11
|
+
import deepClone from "./deepClone.cjs";
|
|
12
|
+
import isArray from "./isArray.cjs";
|
|
13
|
+
import isBrowser from "./isBrowser.cjs";
|
|
14
|
+
import isEmpty from "./isEmpty.cjs";
|
|
15
|
+
import isFunction from "./isFunction.cjs";
|
|
16
|
+
import isNil from "./isNil.cjs";
|
|
17
|
+
import isNumber from "./isNumber.cjs";
|
|
18
|
+
import isObject from "./isObject.cjs";
|
|
19
|
+
import isPrimitive from "./isPrimitive.cjs";
|
|
20
|
+
import isPromise from "./isPromise.cjs";
|
|
21
|
+
import isString from "./isString.cjs";
|
|
22
|
+
import convertCurrencyToChinese from "./convertCurrencyToChinese.cjs";
|
|
23
|
+
import copyToClipboard from "./copyToClipboard.cjs";
|
|
24
|
+
import debounceSubmit from "./debounceSubmit.cjs";
|
|
25
|
+
import decodeBase64 from "./decodeBase64.cjs";
|
|
26
|
+
import downloadFile from "./downloadFile.cjs";
|
|
27
|
+
import encodeBase64 from "./encodeBase64.cjs";
|
|
28
|
+
import formatBankCard from "./formatBankCard.cjs";
|
|
29
|
+
import formatCurrency from "./formatCurrency.cjs";
|
|
30
|
+
import formatFileSize from "./formatFileSize.cjs";
|
|
31
|
+
import formatIdCard from "./formatIdCard.cjs";
|
|
32
|
+
import formatPhone from "./formatPhone.cjs";
|
|
33
|
+
import generateCode from "./generateCode.cjs";
|
|
34
|
+
import getAge from "./getAge.cjs";
|
|
35
|
+
import retry from "./retry.cjs";
|
|
36
|
+
import validateEmail from "./validateEmail.cjs";
|
|
37
|
+
import validateIdCard from "./validateIdCard.cjs";
|
|
38
|
+
import validatePhone from "./validatePhone.cjs";
|
|
39
|
+
import formatDate from "./formatDate.cjs";
|
|
40
|
+
import getRelativeTime from "./getRelativeTime.cjs";
|
|
41
|
+
import isDate from "./isDate.cjs";
|
|
42
|
+
import addClass from "./addClass.cjs";
|
|
43
|
+
import createElement from "./createElement.cjs";
|
|
44
|
+
import getCssVar from "./getCssVar.cjs";
|
|
45
|
+
import getScrollTop from "./getScrollTop.cjs";
|
|
46
|
+
import getStyle from "./getStyle.cjs";
|
|
47
|
+
import getTextWidth from "./getTextWidth.cjs";
|
|
48
|
+
import hasClass from "./hasClass.cjs";
|
|
49
|
+
import insertAfter from "./insertAfter.cjs";
|
|
50
|
+
import isInViewport from "./isInViewport.cjs";
|
|
51
|
+
import lazyLoadImages from "./lazyLoadImages.cjs";
|
|
52
|
+
import off from "./off.cjs";
|
|
53
|
+
import on from "./on.cjs";
|
|
54
|
+
import removeClass from "./removeClass.cjs";
|
|
55
|
+
import removeElement from "./removeElement.cjs";
|
|
56
|
+
import scrollToElement from "./scrollToElement.cjs";
|
|
57
|
+
import setCssVar from "./setCssVar.cjs";
|
|
58
|
+
import setStyle from "./setStyle.cjs";
|
|
59
|
+
import toggleClass from "./toggleClass.cjs";
|
|
60
|
+
import debounce from "./debounce.cjs";
|
|
61
|
+
import delay from "./delay.cjs";
|
|
62
|
+
import memoize from "./memoize.cjs";
|
|
63
|
+
import once from "./once.cjs";
|
|
64
|
+
import throttle from "./throttle.cjs";
|
|
65
|
+
import pick from "./pick.cjs";
|
|
66
|
+
import omit from "./omit.cjs";
|
|
67
|
+
import deepMerge from "./deepMerge.cjs";
|
|
68
|
+
import getByPath from "./getByPath.cjs";
|
|
69
|
+
import mapValues from "./mapValues.cjs";
|
|
70
|
+
import invert from "./invert.cjs";
|
|
71
|
+
import randomInt from "./randomInt.cjs";
|
|
72
|
+
import clamp from "./clamp.cjs";
|
|
73
|
+
import formatThousands from "./formatThousands.cjs";
|
|
74
|
+
import camelCase from "./camelCase.cjs";
|
|
75
|
+
import kebabCase from "./kebabCase.cjs";
|
|
76
|
+
import capitalize from "./capitalize.cjs";
|
|
77
|
+
import uuid from "./uuid.cjs";
|
|
78
|
+
import snakeCase from "./snakeCase.cjs";
|
|
79
|
+
import pascalCase from "./pascalCase.cjs";
|
|
80
|
+
import truncate from "./truncate.cjs";
|
|
81
|
+
import maskString from "./maskString.cjs";
|
|
82
|
+
import parseQueryString from "./parseQueryString.cjs";
|
|
83
|
+
import stringifyQueryString from "./stringifyQueryString.cjs";
|
|
84
|
+
import joinUrl from "./joinUrl.cjs";
|
|
85
|
+
import listToTree from "./listToTree.cjs";
|
|
86
|
+
import treeToList from "./treeToList.cjs";
|
|
87
|
+
import treeFind from "./treeFind.cjs";
|
|
88
|
+
import getStorage from "./getStorage.cjs";
|
|
89
|
+
import setStorage from "./setStorage.cjs";
|
|
90
|
+
import removeStorage from "./removeStorage.cjs";
|
|
91
|
+
export { addClass, camelCase, capitalize, chunk, clamp, convertCurrencyToChinese, copyToClipboard, createElement, debounce, debounceSubmit, decodeBase64, deepClone, deepMerge, delay, difference, downloadFile, encodeBase64, flatten, formatBankCard, formatCurrency, formatDate, formatFileSize, formatIdCard, formatPhone, formatThousands, generateCode, getAge, getByPath, getCssVar, getRelativeTime, getScrollTop, getStorage, getStyle, getTextWidth, groupBy, hasClass, insertAfter, intersection, invert, isArray, isBrowser, isDate, isEmpty, isFunction, isInViewport, isNil, isNumber, isObject, isPrimitive, isPromise, isString, joinUrl, kebabCase, lazyLoadImages, listToTree, mapValues, maskString, memoize, off, omit, on, once, parseQueryString, pascalCase, pick, randomInt, range, removeClass, removeElement, removeStorage, retry, sample, scrollToElement, setCssVar, setStorage, setStyle, snakeCase, sortBy, stringifyQueryString, throttle, toggleClass, treeFind, treeToList, truncate, uniqBy, unique, uuid, validateEmail, validateIdCard, validatePhone };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,91 @@
|
|
|
1
|
-
import chunk from "./
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
|
|
1
|
+
import chunk from "./chunk.js";
|
|
2
|
+
import difference from "./difference.js";
|
|
3
|
+
import flatten from "./flatten.js";
|
|
4
|
+
import groupBy from "./groupBy.js";
|
|
5
|
+
import intersection from "./intersection.js";
|
|
6
|
+
import range from "./range.js";
|
|
7
|
+
import sample from "./sample.js";
|
|
8
|
+
import sortBy from "./sortBy.js";
|
|
9
|
+
import uniqBy from "./uniqBy.js";
|
|
10
|
+
import unique from "./unique.js";
|
|
11
|
+
import deepClone from "./deepClone.js";
|
|
12
|
+
import isArray from "./isArray.js";
|
|
13
|
+
import isBrowser from "./isBrowser.js";
|
|
14
|
+
import isEmpty from "./isEmpty.js";
|
|
15
|
+
import isFunction from "./isFunction.js";
|
|
16
|
+
import isNil from "./isNil.js";
|
|
17
|
+
import isNumber from "./isNumber.js";
|
|
18
|
+
import isObject from "./isObject.js";
|
|
19
|
+
import isPrimitive from "./isPrimitive.js";
|
|
20
|
+
import isPromise from "./isPromise.js";
|
|
21
|
+
import isString from "./isString.js";
|
|
22
|
+
import convertCurrencyToChinese from "./convertCurrencyToChinese.js";
|
|
23
|
+
import copyToClipboard from "./copyToClipboard.js";
|
|
24
|
+
import debounceSubmit from "./debounceSubmit.js";
|
|
25
|
+
import decodeBase64 from "./decodeBase64.js";
|
|
26
|
+
import downloadFile from "./downloadFile.js";
|
|
27
|
+
import encodeBase64 from "./encodeBase64.js";
|
|
28
|
+
import formatBankCard from "./formatBankCard.js";
|
|
29
|
+
import formatCurrency from "./formatCurrency.js";
|
|
30
|
+
import formatFileSize from "./formatFileSize.js";
|
|
31
|
+
import formatIdCard from "./formatIdCard.js";
|
|
32
|
+
import formatPhone from "./formatPhone.js";
|
|
33
|
+
import generateCode from "./generateCode.js";
|
|
34
|
+
import getAge from "./getAge.js";
|
|
35
|
+
import retry from "./retry.js";
|
|
36
|
+
import validateEmail from "./validateEmail.js";
|
|
37
|
+
import validateIdCard from "./validateIdCard.js";
|
|
38
|
+
import validatePhone from "./validatePhone.js";
|
|
39
|
+
import formatDate from "./formatDate.js";
|
|
40
|
+
import getRelativeTime from "./getRelativeTime.js";
|
|
41
|
+
import isDate from "./isDate.js";
|
|
42
|
+
import addClass from "./addClass.js";
|
|
43
|
+
import createElement from "./createElement.js";
|
|
44
|
+
import getCssVar from "./getCssVar.js";
|
|
45
|
+
import getScrollTop from "./getScrollTop.js";
|
|
46
|
+
import getStyle from "./getStyle.js";
|
|
47
|
+
import getTextWidth from "./getTextWidth.js";
|
|
48
|
+
import hasClass from "./hasClass.js";
|
|
49
|
+
import insertAfter from "./insertAfter.js";
|
|
50
|
+
import isInViewport from "./isInViewport.js";
|
|
51
|
+
import lazyLoadImages from "./lazyLoadImages.js";
|
|
52
|
+
import off from "./off.js";
|
|
53
|
+
import on from "./on.js";
|
|
54
|
+
import removeClass from "./removeClass.js";
|
|
55
|
+
import removeElement from "./removeElement.js";
|
|
56
|
+
import scrollToElement from "./scrollToElement.js";
|
|
57
|
+
import setCssVar from "./setCssVar.js";
|
|
58
|
+
import setStyle from "./setStyle.js";
|
|
59
|
+
import toggleClass from "./toggleClass.js";
|
|
60
|
+
import debounce from "./debounce.js";
|
|
61
|
+
import delay from "./delay.js";
|
|
62
|
+
import memoize from "./memoize.js";
|
|
63
|
+
import once from "./once.js";
|
|
64
|
+
import throttle from "./throttle.js";
|
|
65
|
+
import pick from "./pick.js";
|
|
66
|
+
import omit from "./omit.js";
|
|
67
|
+
import deepMerge from "./deepMerge.js";
|
|
68
|
+
import getByPath from "./getByPath.js";
|
|
69
|
+
import mapValues from "./mapValues.js";
|
|
70
|
+
import invert from "./invert.js";
|
|
71
|
+
import randomInt from "./randomInt.js";
|
|
72
|
+
import clamp from "./clamp.js";
|
|
73
|
+
import formatThousands from "./formatThousands.js";
|
|
74
|
+
import camelCase from "./camelCase.js";
|
|
75
|
+
import kebabCase from "./kebabCase.js";
|
|
76
|
+
import capitalize from "./capitalize.js";
|
|
77
|
+
import uuid from "./uuid.js";
|
|
78
|
+
import snakeCase from "./snakeCase.js";
|
|
79
|
+
import pascalCase from "./pascalCase.js";
|
|
80
|
+
import truncate from "./truncate.js";
|
|
81
|
+
import maskString from "./maskString.js";
|
|
82
|
+
import parseQueryString from "./parseQueryString.js";
|
|
83
|
+
import stringifyQueryString from "./stringifyQueryString.js";
|
|
84
|
+
import joinUrl from "./joinUrl.js";
|
|
85
|
+
import listToTree from "./listToTree.js";
|
|
86
|
+
import treeToList from "./treeToList.js";
|
|
87
|
+
import treeFind from "./treeFind.js";
|
|
88
|
+
import getStorage from "./getStorage.js";
|
|
89
|
+
import setStorage from "./setStorage.js";
|
|
90
|
+
import removeStorage from "./removeStorage.js";
|
|
91
|
+
export { addClass, camelCase, capitalize, chunk, clamp, convertCurrencyToChinese, copyToClipboard, createElement, debounce, debounceSubmit, decodeBase64, deepClone, deepMerge, delay, difference, downloadFile, encodeBase64, flatten, formatBankCard, formatCurrency, formatDate, formatFileSize, formatIdCard, formatPhone, formatThousands, generateCode, getAge, getByPath, getCssVar, getRelativeTime, getScrollTop, getStorage, getStyle, getTextWidth, groupBy, hasClass, insertAfter, intersection, invert, isArray, isBrowser, isDate, isEmpty, isFunction, isInViewport, isNil, isNumber, isObject, isPrimitive, isPromise, isString, joinUrl, kebabCase, lazyLoadImages, listToTree, mapValues, maskString, memoize, off, omit, on, once, parseQueryString, pascalCase, pick, randomInt, range, removeClass, removeElement, removeStorage, retry, sample, scrollToElement, setCssVar, setStorage, setStyle, snakeCase, sortBy, stringifyQueryString, throttle, toggleClass, treeFind, treeToList, truncate, uniqBy, unique, uuid, validateEmail, validateIdCard, validatePhone };
|
package/dist/index.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var TWUtils=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Array.isArray(e)}function n(e){return typeof e==`string`}function r(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function i(e,t=new WeakMap){if(typeof e!=`object`||!e)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r=0;r<e.length;r++)n[r]=i(e[r],t);return n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let n=new Map;t.set(e,n);for(let[r,a]of e)n.set(r,i(a,t));return n}if(e instanceof Set){let n=new Set;t.set(e,n);for(let r of e)n.add(i(r,t));return n}if(e instanceof WeakMap)throw Error(`Cannot clone WeakMap`);if(e instanceof WeakSet)throw Error(`Cannot clone WeakSet`);if(r(e)){let n={};t.set(e,n);for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=i(e[r],t));return n}return e}function a(e){return e==null?!0:typeof e==`string`||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:r(e)?Object.keys(e).length===0:!1}function o(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function s(e,t){let n=new Set(t),r={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&!n.has(t)&&(r[t]=e[t]);return r}function c(e,t,n=!1){let r=null,i=n;return function(...a){i&&=(e.apply(this,a),!1),r&&clearTimeout(r),r=setTimeout(()=>{n||e.apply(this,a),r=null,i=n},t)}}function l(e,t){let n=null,r=null;return function(...i){r=i,!n&&(n=setTimeout(()=>{r&&=(e.apply(this,r),null),n=null},t))}}function u(e=0,t){return new Promise(n=>{setTimeout(()=>n(t),e)})}function d(e){return[...new Set(e)]}function f(e,t=1/0){if(t===0)return e;let n=[];for(let r of e)Array.isArray(r)&&t>0?n.push(...f(r,t-1)):n.push(r);return n}function p(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function m(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}function h(e,t,n=1){if(n===0)throw Error(`step 不能为 0`);let r=[];if(n>0)for(let i=e;i<t;i+=n)r.push(i);else for(let i=e;i>t;i+=n)r.push(i);return r}function g(e,t){let n={},r=typeof t==`function`?t:e=>String(e[t]);for(let t of e){let e=String(r(t));n[e]||(n[e]=[]),n[e].push(t)}return n}function _(e,t){return Math.floor(Math.random()*(t-e+1))+e}function v(e,t,n){return Math.min(Math.max(e,t),n)}function y(e){let t=String(e).split(`.`);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,`,`),t.join(`.`)}function b(e,t=`yyyy-MM-dd HH:mm:ss`){if(e==null)return`Invalid Date`;let n=/-/g,r;if(r=typeof e==`string`?new Date(n.test(e)?e.replace(n,`/`):e):new Date(e),isNaN(r.getTime()))return`Invalid Date`;let i={"M+":r.getMonth()+1,"d+":r.getDate(),"H+":r.getHours(),"h+":r.getHours()%12||12,"m+":r.getMinutes(),"s+":r.getSeconds()},a=t.match(/(y+)/);a&&(t=t.replace(a[0],String(r.getFullYear()).slice(4-a[1].length)));for(let e in i){let n=t.match(RegExp(`(${e})`));if(n){let r=String(i[e]);t=t.replace(n[0],n[1].length===1?r:r.padStart(2,`0`))}}return t}function x(e,t=new Date){let n=new Date(e),r=t.getTime()-n.getTime(),i=Math.floor(r/1e3),a=Math.floor(i/60),o=Math.floor(a/60),s=Math.floor(o/24),c=Math.floor(s/30),l=Math.floor(s/365);return i<0?`刚刚`:i<60?`${i}秒前`:a<60?`${a}分钟前`:o<24?`${o}小时前`:s<30?`${s}天前`:c<12?`${c}个月前`:`${l}年前`}function S(e,t=!1){let n=e.replace(/[-_.\s]+(\w|$)/g,(e,t)=>t.toUpperCase());return t&&n.length>0&&(n=n[0].toUpperCase()+n.slice(1)),n}function C(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/([A-Z])([A-Z][a-z])/g,`$1-$2`).replace(/[-_.\s]+/g,`-`).toLowerCase()}function w(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function T(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function E(e){let t=e??(typeof location<`u`?location.search:``);if(!t)return{};let n=t.startsWith(`?`)?t.slice(1):t;if(!n)return{};let r={};for(let e of n.split(`&`)){if(!e)continue;let[t,n=``]=e.split(`=`),i=decodeURIComponent(t),a=D(decodeURIComponent(n));if(i in r){let e=r[i];Array.isArray(e)?e.push(a):r[i]=[e,a]}else r[i]=a}return r}function D(e){if(e===`true`)return!0;if(e===`false`)return!1;if(e===``)return``;let t=Number(e);return!Number.isNaN(t)&&String(t)===e?t:e}function O(e){let t=[];for(let n of Object.keys(e)){let r=e[n];if(r!==void 0){if(r===null){t.push(`${encodeURIComponent(n)}=`);continue}if(Array.isArray(r)){for(let e of r)t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(e))}`);continue}t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}}return t.join(`&`)}return e.camelCase=S,e.capitalize=w,e.chunk=p,e.clamp=v,e.debounce=c,e.deepClone=i,e.delay=u,e.flatten=f,e.formatDate=b,e.formatThousands=y,e.getRelativeTime=x,e.groupBy=g,e.isArray=t,e.isEmpty=a,e.isObject=r,e.isString=n,e.kebabCase=C,e.omit=s,e.parseQueryString=E,e.pick=o,e.randomInt=_,e.range=h,e.shuffle=m,e.stringifyQueryString=O,e.throttle=l,e.unique=d,e.uuid=T,e})({});
|
|
1
|
+
var TWUtils=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Array.isArray(e)}function n(e){return typeof e==`string`}function r(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function i(e,t=new WeakMap){if(typeof e!=`object`||!e)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r=0;r<e.length;r++)n[r]=i(e[r],t);return n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let n=new Map;t.set(e,n);for(let[r,a]of e)n.set(r,i(a,t));return n}if(e instanceof Set){let n=new Set;t.set(e,n);for(let r of e)n.add(i(r,t));return n}if(e instanceof WeakMap)throw Error(`Cannot clone WeakMap`);if(e instanceof WeakSet)throw Error(`Cannot clone WeakSet`);if(r(e)){let n={};t.set(e,n);for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=i(e[r],t));return n}return e}function a(e){return e==null?!0:typeof e==`string`||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:r(e)?Object.keys(e).length===0:!1}function o(e){return e==null}function s(e){return typeof e==`number`&&!Number.isNaN(e)}function c(e){return typeof e==`function`}function l(e){return e instanceof Promise}function u(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function ee(){return typeof window<`u`&&typeof document<`u`}function d(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function f(e,t){let n=new Set(t),r={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&!n.has(t)&&(r[t]=e[t]);return r}function p(...e){let t={};for(let n of e)if(n)for(let e of Object.keys(n)){let i=n[e],a=t[e];r(i)&&r(a)&&!Array.isArray(i)&&!Array.isArray(a)?t[e]=p(a,i):t[e]=i}return t}function te(e,t,n){let r=t.replace(/\[(\d+)\]/g,`.$1`).split(`.`).filter(Boolean),i=e;for(let e of r){if(typeof i!=`object`||!i)return n;i=i[e]}return i===void 0?n:i}function ne(e,t){let n={};for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function m(e){let t={};for(let n of Object.keys(e))t[String(e[n])]=n;return t}function h(e,t,n=!1){let r=null,i=n;return function(...a){i&&=(e.apply(this,a),!1),r&&clearTimeout(r),r=setTimeout(()=>{n||e.apply(this,a),r=null,i=n},t)}}function g(e,t){let n=null,r=null;return function(...i){r=i,!n&&(n=setTimeout(()=>{r&&=(e.apply(this,r),null),n=null},t))}}function _(e=0,t){return new Promise(n=>{setTimeout(()=>n(t),e)})}function v(e){let t=!1,n;return((...r)=>(t||(t=!0,n=e(...r)),n))}function y(e){let t=new Map;return((...n)=>{let r=JSON.stringify(n);if(t.has(r))return t.get(r);let i=e(...n);return t.set(r,i),i})}function b(e){return[...new Set(e)]}function x(e,t=1/0){if(t===0)return e;let n=[];for(let r of e)Array.isArray(r)&&t>0?n.push(...x(r,t-1)):n.push(r);return n}function S(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function C(e,t,n=1){if(n===0)throw Error(`step 不能为 0`);let r=[];if(n>0)for(let i=e;i<t;i+=n)r.push(i);else for(let i=e;i>t;i+=n)r.push(i);return r}function w(e,t){let n={},r=typeof t==`function`?t:e=>String(e[t]);for(let t of e){let e=String(r(t));n[e]||(n[e]=[]),n[e].push(t)}return n}function T(e,t){let n=typeof t==`function`?t:e=>e[t];return[...e].sort((e,t)=>{let r=n(e),i=n(t);return r<i?-1:+(r>i)})}function E(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function D(e,t){let n=new Set(t);return e.filter(e=>n.has(e))}function O(e,t){let n=new Set,r=typeof t==`function`?t:e=>e[t];return e.filter(e=>{let t=r(e);return n.has(t)?!1:(n.add(t),!0)})}function k(e){if(e.length!==0)return e[Math.floor(Math.random()*e.length)]}function A(e,t){return Math.floor(Math.random()*(t-e+1))+e}function j(e,t,n){return Math.min(Math.max(e,t),n)}function M(e){let t=String(e).split(`.`);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,`,`),t.join(`.`)}function N(e,t=`yyyy-MM-dd HH:mm:ss`){if(e==null)return`Invalid Date`;let n=/-/g,r;if(r=typeof e==`string`?new Date(n.test(e)?e.replace(n,`/`):e):new Date(e),isNaN(r.getTime()))return`Invalid Date`;let i={"M+":r.getMonth()+1,"d+":r.getDate(),"H+":r.getHours(),"h+":r.getHours()%12||12,"m+":r.getMinutes(),"s+":r.getSeconds()},a=t.match(/(y+)/);a&&(t=t.replace(a[0],String(r.getFullYear()).slice(4-a[1].length)));for(let e in i){let n=t.match(RegExp(`(${e})`));if(n){let r=String(i[e]);t=t.replace(n[0],n[1].length===1?r:r.padStart(2,`0`))}}return t}function P(e,t=new Date){let n=new Date(e),r=t.getTime()-n.getTime(),i=Math.floor(r/1e3),a=Math.floor(i/60),o=Math.floor(a/60),s=Math.floor(o/24),c=Math.floor(s/30),l=Math.floor(s/365);return i<0?`刚刚`:i<60?`${i}秒前`:a<60?`${a}分钟前`:o<24?`${o}小时前`:s<30?`${s}天前`:c<12?`${c}个月前`:`${l}年前`}function F(e){return e instanceof Date}function I(e,t=!1){let n=e.replace(/[-_.\s]+(\w|$)/g,(e,t)=>t.toUpperCase());return t&&n.length>0&&(n=n[0].toUpperCase()+n.slice(1)),n}function L(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/([A-Z])([A-Z][a-z])/g,`$1-$2`).replace(/[-_.\s]+/g,`-`).toLowerCase()}function R(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function z(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function B(e){return e.replace(/[A-Z]/g,(e,t)=>t===0?e:`_`+e).replace(/[-_\s]+/g,`_`).toLowerCase()}function V(e){return e.replace(/[-_.\s]+(\w|$)/g,(e,t)=>t.toUpperCase()).replace(/^[a-z]/,e=>e.toUpperCase())}function H(e,t,n=`…`){return e.length<=t?e:e.slice(0,t-n.length)+n}function U(e,t=3,n=4,r=`*`){return e.length<=t+n?e:e.slice(0,t)+r.repeat(e.length-t-n)+e.slice(-n)}function W(e){let t=e??(typeof location<`u`?location.search:``);if(!t)return{};let n=t.startsWith(`?`)?t.slice(1):t;if(!n)return{};let r={};for(let e of n.split(`&`)){if(!e)continue;let[t,n=``]=e.split(`=`),i=decodeURIComponent(t),a=G(decodeURIComponent(n));if(i in r){let e=r[i];Array.isArray(e)?e.push(a):r[i]=[e,a]}else r[i]=a}return r}function G(e){if(e===`true`)return!0;if(e===`false`)return!1;if(e===``)return``;let t=Number(e);return!Number.isNaN(t)&&String(t)===e?t:e}function K(e){let t=[];for(let n of Object.keys(e)){let r=e[n];if(r!==void 0){if(r===null){t.push(`${encodeURIComponent(n)}=`);continue}if(Array.isArray(r)){for(let e of r)t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(e))}`);continue}t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}}return t.join(`&`)}function q(...e){return e.map((e,t)=>t===0?e.replace(/\/+$/,``):e.replace(/^\/+|\/+$/g,``)).filter(Boolean).join(`/`)}function J(e,t={}){let{id:n=`id`,parentId:r=`parentId`,children:i=`children`,rootValue:a=null}=t,o=new Map,s=[];for(let t of e){let e={...t,[i]:[]};o.set(t[n],e)}for(let t of e){let e=o.get(t[n]),c=t[r];if(c===a)s.push(e);else{let t=o.get(c);t&&t[i].push(e)}}return s}function Y(e,t={}){let{children:n=`children`}=t,r=[],i=[...e];for(;i.length;){let{[n]:e,...t}=i.shift();r.push(t),Array.isArray(e)&&i.push(...e)}return r}function X(e,t,n={}){let{children:r=`children`}=n;for(let i of e){if(t(i))return i;let e=i[r];if(Array.isArray(e)){let r=X(e,t,n);if(r)return r}}}function Z(e,t){try{let n=localStorage.getItem(e);return n===null?t??null:JSON.parse(n)}catch{return t??null}}function re(e,t){try{return localStorage.setItem(e,JSON.stringify(t)),!0}catch{return!1}}function ie(e){try{localStorage.removeItem(e)}catch{}}function ae(e,t={}){let{unit:n=`cent`,symbol:r=`¥`,decimals:i=2}=t;return`${r}${(n===`cent`?e/100:e).toFixed(i).replace(/\B(?=(\d{3})+(?!\d))/g,`,`)}`}function oe(e,t=2){if(e===0)return`0 B`;let n=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`],r=1024,i=Math.floor(Math.log(e)/Math.log(r));return`${Number.parseFloat((e/r**i).toFixed(t))} ${n[i]}`}async function se(e){try{if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)return await navigator.clipboard.writeText(e),!0}catch{}let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();try{return document.execCommand(`copy`)}catch{return!1}finally{document.body.removeChild(t)}}function ce(e,t){let n=typeof e==`string`?e:URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.style.display=`none`,document.body.appendChild(r),r.click(),document.body.removeChild(r),e instanceof Blob&&URL.revokeObjectURL(n)}function le(e,t=`display`){return t===`mask`?e.replace(/(\d{3})\d{4}(\d{4})/,`$1****$2`):e.replace(/(\d{3})(\d{4})(\d{4})/,`$1-$2-$3`)}function ue(e,t=`mask`){return t===`display`?e.replace(/(\d{6})(\d{8})(\d{4})/,`$1 $2 $3`):e.replace(/(\d{6})\d{8}(\d{4})/,`$1********$2`)}function de(e){return e.replace(/(\d{4})(?=\d)/g,`$1 `)}function fe(e){return/^1[3-9]\d{9}$/.test(e)}function pe(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function me(e){if(!/^\d{17}[\dXx]$/.test(e))return!1;let t=e.substring(0,2);if(Number.parseInt(t)<11||Number.parseInt(t)>82)return!1;let n=e.substring(6,14),r=Number.parseInt(n.substring(0,4)),i=Number.parseInt(n.substring(4,6)),a=Number.parseInt(n.substring(6,8));if(r<1900||r>2100||i<1||i>12||a<1||a>31)return!1;let o=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],s=[`1`,`0`,`X`,`9`,`8`,`7`,`6`,`5`,`4`,`3`,`2`],c=0;for(let t=0;t<17;t++)c+=Number.parseInt(e[t])*o[t];return s[c%11]===e[17].toUpperCase()}async function he(e,t=3,n=1e3){let r;for(let i=0;i<=t;i++)try{return await e()}catch(e){r=e,i<t&&await new Promise(e=>setTimeout(e,n))}throw r}function ge(e=6,t=`mixed`){let n={number:`0123456789`,letter:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,mixed:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`}[t],r=``;for(let t=0;t<e;t++)r+=n[Math.floor(Math.random()*n.length)];return r}function _e(e){if(e===0)return`零元整`;let t=`零壹贰叁肆伍陆柒捌玖`,n=[``,`拾`,`佰`,`仟`],r=[``,`万`,`亿`],[i,a]=e.toFixed(2).split(`.`),o=i.length,s=``;for(let e=0;e<o;e++){let a=Number.parseInt(i[e]),c=o-1-e,l=c%4,u=Math.floor(c/4);a===0?e<o-1&&i[e+1]!==`0`&&(s+=t[0]):s+=t[a]+n[l],l===0&&u>0&&i.substring(e+1).replace(/0+$/,``).length>0&&(s+=r[u])}s+=`元`;let c=Number.parseInt(a[0]),l=Number.parseInt(a[1]);return c===0&&l===0?s+=`整`:(c>0&&(s+=t[c]+`角`),l>0&&(s+=t[l]+`分`)),s}function ve(e){let t=!1;return(async(...n)=>{if(!t){t=!0;try{return await e(...n)}finally{t=!1}}})}function ye(e,t){let n;n=e.length===18?`${e.substring(6,10)}-${e.substring(10,12)}-${e.substring(12,14)}`:e;let r=new Date(n),i=t?new Date(t):new Date,a=i.getFullYear()-r.getFullYear(),o=i.getMonth()-r.getMonth(),s=i.getDate()-r.getDate();return(o<0||o===0&&s<0)&&a--,a}function be(e){return btoa(unescape(encodeURIComponent(e)))}function xe(e){return decodeURIComponent(escape(atob(e)))}function Se(e,t){return e.classList.contains(t)}function Ce(e,t){e.classList.add(...t.split(/\s+/).filter(Boolean))}function we(e,t){e.classList.remove(...t.split(/\s+/).filter(Boolean))}function Te(e,t,n){return e.classList.toggle(t,n)}function Ee(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function De(e,t){for(let n of Object.keys(t))e.style[n]=String(t[n])}function Oe(e,t,n,r){e.addEventListener(t,n,r)}function Q(e,t,n,r){e.removeEventListener(t,n,r)}function ke(e,t){if(e===void 0){let e=t||window;return e===window?window.scrollY||document.documentElement.scrollTop:e.scrollTop}let n=t||window;n===window?window.scrollTo({top:e}):n.scrollTop=e}function Ae(e,t=0){let n=e.getBoundingClientRect(),{innerHeight:r,innerWidth:i}=window;return n.top<r+t&&n.bottom>-t&&n.left<i+t&&n.right>-t}function je(e,t={},...n){let r=document.createElement(e);for(let e of Object.keys(t))r.setAttribute(e,t[e]);for(let e of n)r.appendChild(typeof e==`string`?document.createTextNode(e):e);return r}function Me(e,t){let n=t.parentNode;n&&n.insertBefore(e,t.nextSibling)}function Ne(e){e.remove()}function Pe(e,t){e.scrollIntoView({behavior:`smooth`,block:`start`,...t})}function Fe(e,t=document.documentElement){let n=e.startsWith(`--`)?e:`--${e}`;return getComputedStyle(t).getPropertyValue(n).trim()}function Ie(e,t,n=document.documentElement){let r=e.startsWith(`--`)?e:`--${e}`;n.style.setProperty(r,t)}let $=null;function Le(){return $||=document.createElement(`canvas`).getContext(`2d`),$}function Re(e,t){let n=Le();return n.font=t,n.measureText(e).width}function ze(e=`img[data-src]`){let t=new IntersectionObserver(e=>{for(let n of e){if(!n.isIntersecting)continue;let e=n.target,r=e.dataset.src;r&&(e.src=r,delete e.dataset.src),t.unobserve(e)}},{rootMargin:`100px`}),n=document.querySelectorAll(e);for(let e of n)t.observe(e);return()=>t.disconnect()}return e.addClass=Ce,e.camelCase=I,e.capitalize=R,e.chunk=S,e.clamp=j,e.convertCurrencyToChinese=_e,e.copyToClipboard=se,e.createElement=je,e.debounce=h,e.debounceSubmit=ve,e.decodeBase64=xe,e.deepClone=i,e.deepMerge=p,e.delay=_,e.difference=E,e.downloadFile=ce,e.encodeBase64=be,e.flatten=x,e.formatBankCard=de,e.formatCurrency=ae,e.formatDate=N,e.formatFileSize=oe,e.formatIdCard=ue,e.formatPhone=le,e.formatThousands=M,e.generateCode=ge,e.getAge=ye,e.getByPath=te,e.getCssVar=Fe,e.getRelativeTime=P,e.getScrollTop=ke,e.getStorage=Z,e.getStyle=Ee,e.getTextWidth=Re,e.groupBy=w,e.hasClass=Se,e.insertAfter=Me,e.intersection=D,e.invert=m,e.isArray=t,e.isBrowser=ee,e.isDate=F,e.isEmpty=a,e.isFunction=c,e.isInViewport=Ae,e.isNil=o,e.isNumber=s,e.isObject=r,e.isPrimitive=u,e.isPromise=l,e.isString=n,e.joinUrl=q,e.kebabCase=L,e.lazyLoadImages=ze,e.listToTree=J,e.mapValues=ne,e.maskString=U,e.memoize=y,e.off=Q,e.omit=f,e.on=Oe,e.once=v,e.parseQueryString=W,e.pascalCase=V,e.pick=d,e.randomInt=A,e.range=C,e.removeClass=we,e.removeElement=Ne,e.removeStorage=ie,e.retry=he,e.sample=k,e.scrollToElement=Pe,e.setCssVar=Ie,e.setStorage=re,e.setStyle=De,e.snakeCase=B,e.sortBy=T,e.stringifyQueryString=K,e.throttle=g,e.toggleClass=Te,e.treeFind=X,e.treeToList=Y,e.truncate=H,e.uniqBy=O,e.unique=b,e.uuid=z,e.validateEmail=pe,e.validateIdCard=me,e.validatePhone=fe,e})({});
|