umt 2.12.3 → 2.14.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/README.md +60 -0
- package/module/Array/arraysJoin.js +1 -1
- package/module/Array/arraysJoin.js.map +1 -1
- package/module/Array/chunk.js +1 -2
- package/module/Array/chunk.js.map +1 -1
- package/module/Array/generateNumberArray.js +13 -3
- package/module/Array/generateNumberArray.js.map +1 -1
- package/module/Array/getArraysDiff.js +5 -1
- package/module/Array/getArraysDiff.js.map +1 -1
- package/module/Array/mergeSort.js +45 -18
- package/module/Array/mergeSort.js.map +1 -1
- package/module/Array/pop.js +2 -1
- package/module/Array/pop.js.map +1 -1
- package/module/Array/randomSelect.js +8 -0
- package/module/Array/randomSelect.js.map +1 -1
- package/module/Array/sortingHelpers/rangeValidator.js +3 -2
- package/module/Array/sortingHelpers/rangeValidator.js.map +1 -1
- package/module/Array/timSort.js +25 -23
- package/module/Array/timSort.js.map +1 -1
- package/module/Array/ultraNumberSort.js +214 -136
- package/module/Array/ultraNumberSort.js.map +1 -1
- package/module/Async/defer.d.ts +18 -0
- package/module/Async/defer.js +19 -0
- package/module/Async/defer.js.map +1 -0
- package/module/Async/index.d.ts +4 -0
- package/module/Async/index.js +5 -0
- package/module/Async/index.js.map +1 -0
- package/module/Async/parallel.d.ts +10 -0
- package/module/Async/parallel.js +44 -0
- package/module/Async/parallel.js.map +1 -0
- package/module/Async/sleep.d.ts +8 -0
- package/module/Async/sleep.js +11 -0
- package/module/Async/sleep.js.map +1 -0
- package/module/Async/timeout.d.ts +10 -0
- package/module/Async/timeout.js +22 -0
- package/module/Async/timeout.js.map +1 -0
- package/module/Color/cmykToRgba.js +6 -7
- package/module/Color/cmykToRgba.js.map +1 -1
- package/module/Color/hexaToRgba.js +1 -8
- package/module/Color/hexaToRgba.js.map +1 -1
- package/module/Color/hslaToRgba.d.ts +0 -1
- package/module/Color/hslaToRgba.js +7 -22
- package/module/Color/hslaToRgba.js.map +1 -1
- package/module/Color/rgbaToCmyk.js +0 -11
- package/module/Color/rgbaToCmyk.js.map +1 -1
- package/module/Color/rgbaToHexA.js +2 -15
- package/module/Color/rgbaToHexA.js.map +1 -1
- package/module/Color/rgbaToHsla.d.ts +0 -1
- package/module/Color/rgbaToHsla.js +0 -12
- package/module/Color/rgbaToHsla.js.map +1 -1
- package/module/Crypto/constants.d.ts +2 -0
- package/module/Crypto/constants.js +3 -0
- package/module/Crypto/constants.js.map +1 -0
- package/module/Crypto/decodeBase32.js +4 -5
- package/module/Crypto/decodeBase32.js.map +1 -1
- package/module/Crypto/decodeBase58.js +7 -6
- package/module/Crypto/decodeBase58.js.map +1 -1
- package/module/Crypto/encodeBase32.js +2 -1
- package/module/Crypto/encodeBase32.js.map +1 -1
- package/module/Crypto/encodeBase58.js +7 -3
- package/module/Crypto/encodeBase58.js.map +1 -1
- package/module/DataStructure/index.d.ts +2 -0
- package/module/DataStructure/index.js +2 -0
- package/module/DataStructure/index.js.map +1 -1
- package/module/DataStructure/lruCache.d.ts +139 -0
- package/module/DataStructure/lruCache.js +172 -0
- package/module/DataStructure/lruCache.js.map +1 -0
- package/module/DataStructure/ttlCache.d.ts +139 -0
- package/module/DataStructure/ttlCache.js +172 -0
- package/module/DataStructure/ttlCache.js.map +1 -0
- package/module/Error/flatMapResult.d.ts +23 -0
- package/module/Error/flatMapResult.js +28 -0
- package/module/Error/flatMapResult.js.map +1 -0
- package/module/Error/index.d.ts +3 -0
- package/module/Error/index.js +3 -0
- package/module/Error/index.js.map +1 -1
- package/module/Error/mapResult.d.ts +21 -0
- package/module/Error/mapResult.js +27 -0
- package/module/Error/mapResult.js.map +1 -0
- package/module/Error/matchResult.d.ts +25 -0
- package/module/Error/matchResult.js +27 -0
- package/module/Error/matchResult.js.map +1 -0
- package/module/Error/safeExecute.d.ts +16 -3
- package/module/Error/safeExecute.js +5 -2
- package/module/Error/safeExecute.js.map +1 -1
- package/module/Function/debounce.d.ts +38 -0
- package/module/Function/debounce.js +67 -0
- package/module/Function/debounce.js.map +1 -0
- package/module/Function/index.d.ts +4 -0
- package/module/Function/index.js +4 -0
- package/module/Function/index.js.map +1 -1
- package/module/Function/memoize.d.ts +36 -0
- package/module/Function/memoize.js +54 -0
- package/module/Function/memoize.js.map +1 -0
- package/module/Function/once.d.ts +18 -0
- package/module/Function/once.js +29 -0
- package/module/Function/once.js.map +1 -0
- package/module/Function/throttle.d.ts +25 -0
- package/module/Function/throttle.js +55 -0
- package/module/Function/throttle.js.map +1 -0
- package/module/IP/cidrToLong.d.ts +0 -1
- package/module/IP/cidrToLong.js +0 -4
- package/module/IP/cidrToLong.js.map +1 -1
- package/module/IP/cidrToSubnetMask.d.ts +0 -1
- package/module/IP/cidrToSubnetMask.js +0 -1
- package/module/IP/cidrToSubnetMask.js.map +1 -1
- package/module/IP/getNetworkAddress.d.ts +0 -1
- package/module/IP/getNetworkAddress.js +2 -32
- package/module/IP/getNetworkAddress.js.map +1 -1
- package/module/IP/ipToBinaryString.d.ts +0 -1
- package/module/IP/ipToBinaryString.js +2 -25
- package/module/IP/ipToBinaryString.js.map +1 -1
- package/module/IP/ipToLong.d.ts +0 -1
- package/module/IP/ipToLong.js +0 -1
- package/module/IP/ipToLong.js.map +1 -1
- package/module/IP/isInRange.d.ts +0 -1
- package/module/IP/isInRange.js +5 -28
- package/module/IP/isInRange.js.map +1 -1
- package/module/IP/isPrivateIp.d.ts +0 -1
- package/module/IP/isPrivateIp.js +1 -10
- package/module/IP/isPrivateIp.js.map +1 -1
- package/module/IP/longToIp.d.ts +0 -1
- package/module/IP/longToIp.js +0 -8
- package/module/IP/longToIp.js.map +1 -1
- package/module/IP/subnetMaskToCidr.d.ts +0 -1
- package/module/IP/subnetMaskToCidr.js +2 -23
- package/module/IP/subnetMaskToCidr.js.map +1 -1
- package/module/Iterator/index.d.ts +3 -0
- package/module/Iterator/index.js +4 -0
- package/module/Iterator/index.js.map +1 -0
- package/module/Iterator/lazyFilter.d.ts +10 -0
- package/module/Iterator/lazyFilter.js +19 -0
- package/module/Iterator/lazyFilter.js.map +1 -0
- package/module/Iterator/lazyMap.d.ts +10 -0
- package/module/Iterator/lazyMap.js +17 -0
- package/module/Iterator/lazyMap.js.map +1 -0
- package/module/Iterator/lazyTake.d.ts +10 -0
- package/module/Iterator/lazyTake.js +20 -0
- package/module/Iterator/lazyTake.js.map +1 -0
- package/module/Math/addition.js +20 -4
- package/module/Math/addition.js.map +1 -1
- package/module/Math/average.js +3 -3
- package/module/Math/average.js.map +1 -1
- package/module/Math/bitwise.js +1 -1
- package/module/Math/bitwise.js.map +1 -1
- package/module/Math/calculator/core.js +2 -1
- package/module/Math/calculator/core.js.map +1 -1
- package/module/Math/calculator/literalExpression.js +1 -1
- package/module/Math/clamp.d.ts +16 -0
- package/module/Math/clamp.js +19 -0
- package/module/Math/clamp.js.map +1 -0
- package/module/Math/correlationCoefficient.js +0 -3
- package/module/Math/correlationCoefficient.js.map +1 -1
- package/module/Math/inRange.d.ts +19 -0
- package/module/Math/inRange.js +24 -0
- package/module/Math/inRange.js.map +1 -0
- package/module/Math/index.d.ts +3 -0
- package/module/Math/index.js +3 -0
- package/module/Math/index.js.map +1 -1
- package/module/Math/median.js +2 -2
- package/module/Math/median.js.map +1 -1
- package/module/Math/nCr.js +2 -4
- package/module/Math/nCr.js.map +1 -1
- package/module/Math/percentile.js +2 -5
- package/module/Math/percentile.js.map +1 -1
- package/module/Math/primeFactorization.js +1 -1
- package/module/Math/primeFactorization.js.map +1 -1
- package/module/Math/sumPrecise.d.ts +14 -0
- package/module/Math/sumPrecise.js +27 -0
- package/module/Math/sumPrecise.js.map +1 -0
- package/module/Math/uuidv7.js +56 -22
- package/module/Math/uuidv7.js.map +1 -1
- package/module/Number/formatNumber.d.ts +42 -0
- package/module/Number/formatNumber.js +44 -0
- package/module/Number/formatNumber.js.map +1 -0
- package/module/Number/index.d.ts +3 -0
- package/module/Number/index.js +4 -0
- package/module/Number/index.js.map +1 -0
- package/module/Number/toOrdinal.d.ts +20 -0
- package/module/Number/toOrdinal.js +37 -0
- package/module/Number/toOrdinal.js.map +1 -0
- package/module/Number/toPercentage.d.ts +20 -0
- package/module/Number/toPercentage.js +27 -0
- package/module/Number/toPercentage.js.map +1 -0
- package/module/Object/deepClone.d.ts +15 -0
- package/module/Object/deepClone.js +65 -0
- package/module/Object/deepClone.js.map +1 -0
- package/module/Object/getObjectsCommon.d.ts +23 -0
- package/module/Object/getObjectsCommon.js +60 -0
- package/module/Object/getObjectsCommon.js.map +1 -0
- package/module/Object/getObjectsDiff.d.ts +25 -0
- package/module/Object/getObjectsDiff.js +79 -0
- package/module/Object/getObjectsDiff.js.map +1 -0
- package/module/Object/index.d.ts +6 -0
- package/module/Object/index.js +6 -0
- package/module/Object/index.js.map +1 -1
- package/module/Object/isPlainObject.d.ts +16 -0
- package/module/Object/isPlainObject.js +32 -0
- package/module/Object/isPlainObject.js.map +1 -0
- package/module/Object/mapKeys.d.ts +15 -0
- package/module/Object/mapKeys.js +28 -0
- package/module/Object/mapKeys.js.map +1 -0
- package/module/Object/mapValues.d.ts +15 -0
- package/module/Object/mapValues.js +27 -0
- package/module/Object/mapValues.js.map +1 -0
- package/module/Object/mergeDeep.js +4 -9
- package/module/Object/mergeDeep.js.map +1 -1
- package/module/Object/omit.d.ts +1 -1
- package/module/Object/omit.js.map +1 -1
- package/module/Object/pickDeep.js +6 -1
- package/module/Object/pickDeep.js.map +1 -1
- package/module/Predicate/every.d.ts +14 -0
- package/module/Predicate/every.js +22 -0
- package/module/Predicate/every.js.map +1 -0
- package/module/Predicate/index.d.ts +6 -0
- package/module/Predicate/index.js +7 -0
- package/module/Predicate/index.js.map +1 -0
- package/module/Predicate/isNotNullish.d.ts +11 -0
- package/module/Predicate/isNotNullish.js +12 -0
- package/module/Predicate/isNotNullish.js.map +1 -0
- package/module/Predicate/isNullish.d.ts +11 -0
- package/module/Predicate/isNullish.js +12 -0
- package/module/Predicate/isNullish.js.map +1 -0
- package/module/Predicate/matches.d.ts +11 -0
- package/module/Predicate/matches.js +20 -0
- package/module/Predicate/matches.js.map +1 -0
- package/module/Predicate/not.d.ts +10 -0
- package/module/Predicate/not.js +11 -0
- package/module/Predicate/not.js.map +1 -0
- package/module/Predicate/some.d.ts +15 -0
- package/module/Predicate/some.js +23 -0
- package/module/Predicate/some.js.map +1 -0
- package/module/String/camelCase.js +2 -2
- package/module/String/camelCase.js.map +1 -1
- package/module/String/escapeHtml.js +1 -1
- package/module/String/formatString/getValue.js +1 -1
- package/module/String/formatString/getValue.js.map +1 -1
- package/module/String/fromBase64.d.ts +0 -1
- package/module/String/fromBase64.js +1 -9
- package/module/String/fromBase64.js.map +1 -1
- package/module/String/fuzzySearch.js +74 -6
- package/module/String/fuzzySearch.js.map +1 -1
- package/module/String/kebabCase.js +1 -1
- package/module/String/kebabCase.js.map +1 -1
- package/module/String/levenshteinDistance.js +1 -2
- package/module/String/levenshteinDistance.js.map +1 -1
- package/module/String/randomString.js +23 -2
- package/module/String/randomString.js.map +1 -1
- package/module/String/reverseString.js +1 -1
- package/module/String/reverseString.js.map +1 -1
- package/module/String/slugify.js +1 -1
- package/module/String/toHalfWidth.js +2 -2
- package/module/String/toHalfWidth.js.map +1 -1
- package/module/String/truncate.js +0 -3
- package/module/String/truncate.js.map +1 -1
- package/module/String/unescapeHtml.js +1 -1
- package/module/String/unescapeHtml.js.map +1 -1
- package/module/Time/convertTime.js +4 -3
- package/module/Time/convertTime.js.map +1 -1
- package/module/Tool/escapeRegExp.d.ts +8 -0
- package/module/Tool/escapeRegExp.js +11 -0
- package/module/Tool/escapeRegExp.js.map +1 -0
- package/module/Tool/index.d.ts +1 -0
- package/module/Tool/index.js +1 -0
- package/module/Tool/index.js.map +1 -1
- package/module/URL/buildUrl.d.ts +17 -0
- package/module/URL/buildUrl.js +24 -0
- package/module/URL/buildUrl.js.map +1 -0
- package/module/URL/index.d.ts +4 -0
- package/module/URL/index.js +5 -0
- package/module/URL/index.js.map +1 -0
- package/module/URL/isAbsoluteUrl.d.ts +20 -0
- package/module/URL/isAbsoluteUrl.js +23 -0
- package/module/URL/isAbsoluteUrl.js.map +1 -0
- package/module/URL/joinPath.d.ts +24 -0
- package/module/URL/joinPath.js +43 -0
- package/module/URL/joinPath.js.map +1 -0
- package/module/URL/parseQueryString.d.ts +22 -0
- package/module/URL/parseQueryString.js +34 -0
- package/module/URL/parseQueryString.js.map +1 -0
- package/module/Validate/parseEmail.js +5 -5
- package/module/Validate/parseEmail.js.map +1 -1
- package/module/es5/Array/arraysJoin.js +1 -1
- package/module/es5/Array/chunk.js +3 -2
- package/module/es5/Array/generateNumberArray.js +21 -3
- package/module/es5/Array/getArraysDiff.js +5 -3
- package/module/es5/Array/mergeSort.js +51 -19
- package/module/es5/Array/pop.js +2 -7
- package/module/es5/Array/randomSelect.js +8 -0
- package/module/es5/Array/sortingHelpers/rangeValidator.js +3 -2
- package/module/es5/Array/timSort.js +25 -23
- package/module/es5/Array/ultraNumberSort.js +243 -243
- package/module/es5/Async/defer.d.ts +18 -0
- package/module/es5/Async/defer.js +32 -0
- package/module/es5/Async/index.d.ts +4 -0
- package/module/es5/Async/index.js +49 -0
- package/module/es5/Async/parallel.d.ts +10 -0
- package/module/es5/Async/parallel.js +48 -0
- package/module/es5/Async/sleep.d.ts +8 -0
- package/module/es5/Async/sleep.js +18 -0
- package/module/es5/Async/timeout.d.ts +10 -0
- package/module/es5/Async/timeout.js +29 -0
- package/module/es5/Color/cmykToRgba.js +6 -7
- package/module/es5/Color/hexaToRgba.js +7 -5
- package/module/es5/Color/hslaToRgba.d.ts +0 -1
- package/module/es5/Color/hslaToRgba.js +7 -22
- package/module/es5/Color/rgbaToCmyk.js +0 -4
- package/module/es5/Color/rgbaToHexA.js +2 -6
- package/module/es5/Color/rgbaToHsla.d.ts +0 -1
- package/module/es5/Color/rgbaToHsla.js +0 -5
- package/module/es5/Crypto/constants.d.ts +2 -0
- package/module/es5/Crypto/constants.js +8 -0
- package/module/es5/Crypto/decodeBase32.js +12 -5
- package/module/es5/Crypto/decodeBase58.js +14 -8
- package/module/es5/Crypto/encodeBase32.js +2 -1
- package/module/es5/Crypto/encodeBase58.js +8 -3
- package/module/es5/DataStructure/index.d.ts +2 -0
- package/module/es5/DataStructure/index.js +22 -0
- package/module/es5/DataStructure/lruCache.d.ts +139 -0
- package/module/es5/DataStructure/lruCache.js +205 -0
- package/module/es5/DataStructure/ttlCache.d.ts +139 -0
- package/module/es5/DataStructure/ttlCache.js +211 -0
- package/module/es5/Error/flatMapResult.d.ts +23 -0
- package/module/es5/Error/flatMapResult.js +33 -0
- package/module/es5/Error/index.d.ts +3 -0
- package/module/es5/Error/index.js +33 -0
- package/module/es5/Error/mapResult.d.ts +21 -0
- package/module/es5/Error/mapResult.js +32 -0
- package/module/es5/Error/matchResult.d.ts +25 -0
- package/module/es5/Error/matchResult.js +32 -0
- package/module/es5/Error/safeExecute.d.ts +16 -3
- package/module/es5/Error/safeExecute.js +3 -3
- package/module/es5/Function/debounce.d.ts +38 -0
- package/module/es5/Function/debounce.js +88 -0
- package/module/es5/Function/index.d.ts +4 -0
- package/module/es5/Function/index.js +44 -0
- package/module/es5/Function/memoize.d.ts +36 -0
- package/module/es5/Function/memoize.js +73 -0
- package/module/es5/Function/once.d.ts +18 -0
- package/module/es5/Function/once.js +37 -0
- package/module/es5/Function/throttle.d.ts +25 -0
- package/module/es5/Function/throttle.js +69 -0
- package/module/es5/IP/cidrToLong.d.ts +0 -1
- package/module/es5/IP/cidrToLong.js +0 -4
- package/module/es5/IP/cidrToSubnetMask.d.ts +0 -1
- package/module/es5/IP/cidrToSubnetMask.js +0 -1
- package/module/es5/IP/getNetworkAddress.d.ts +0 -1
- package/module/es5/IP/getNetworkAddress.js +2 -31
- package/module/es5/IP/ipToBinaryString.d.ts +0 -1
- package/module/es5/IP/ipToBinaryString.js +1 -40
- package/module/es5/IP/ipToLong.d.ts +0 -1
- package/module/es5/IP/ipToLong.js +0 -1
- package/module/es5/IP/isInRange.d.ts +0 -1
- package/module/es5/IP/isInRange.js +5 -29
- package/module/es5/IP/isPrivateIp.d.ts +0 -1
- package/module/es5/IP/isPrivateIp.js +3 -12
- package/module/es5/IP/longToIp.d.ts +0 -1
- package/module/es5/IP/longToIp.js +0 -6
- package/module/es5/IP/subnetMaskToCidr.d.ts +0 -1
- package/module/es5/IP/subnetMaskToCidr.js +2 -26
- package/module/es5/Iterator/index.d.ts +3 -0
- package/module/es5/Iterator/index.js +38 -0
- package/module/es5/Iterator/lazyFilter.d.ts +10 -0
- package/module/es5/Iterator/lazyFilter.js +63 -0
- package/module/es5/Iterator/lazyMap.d.ts +10 -0
- package/module/es5/Iterator/lazyMap.js +59 -0
- package/module/es5/Iterator/lazyTake.d.ts +10 -0
- package/module/es5/Iterator/lazyTake.js +65 -0
- package/module/es5/Math/addition.js +24 -14
- package/module/es5/Math/average.js +3 -5
- package/module/es5/Math/bitwise.js +1 -1
- package/module/es5/Math/calculator/core.js +2 -1
- package/module/es5/Math/calculator/literalExpression.js +1 -1
- package/module/es5/Math/clamp.d.ts +16 -0
- package/module/es5/Math/clamp.js +24 -0
- package/module/es5/Math/correlationCoefficient.js +0 -3
- package/module/es5/Math/inRange.d.ts +19 -0
- package/module/es5/Math/inRange.js +29 -0
- package/module/es5/Math/index.d.ts +3 -0
- package/module/es5/Math/index.js +33 -0
- package/module/es5/Math/median.js +2 -2
- package/module/es5/Math/nCr.js +2 -4
- package/module/es5/Math/percentile.js +2 -11
- package/module/es5/Math/primeFactorization.js +1 -1
- package/module/es5/Math/sumPrecise.d.ts +14 -0
- package/module/es5/Math/sumPrecise.js +41 -0
- package/module/es5/Math/uuidv7.js +25 -40
- package/module/es5/Number/formatNumber.d.ts +42 -0
- package/module/es5/Number/formatNumber.js +58 -0
- package/module/es5/Number/index.d.ts +3 -0
- package/module/es5/Number/index.js +38 -0
- package/module/es5/Number/toOrdinal.d.ts +20 -0
- package/module/es5/Number/toOrdinal.js +42 -0
- package/module/es5/Number/toPercentage.d.ts +20 -0
- package/module/es5/Number/toPercentage.js +33 -0
- package/module/es5/Object/deepClone.d.ts +15 -0
- package/module/es5/Object/deepClone.js +110 -0
- package/module/es5/Object/getObjectsCommon.d.ts +23 -0
- package/module/es5/Object/getObjectsCommon.js +92 -0
- package/module/es5/Object/getObjectsDiff.d.ts +25 -0
- package/module/es5/Object/getObjectsDiff.js +146 -0
- package/module/es5/Object/index.d.ts +6 -0
- package/module/es5/Object/index.js +66 -0
- package/module/es5/Object/isPlainObject.d.ts +16 -0
- package/module/es5/Object/isPlainObject.js +39 -0
- package/module/es5/Object/mapKeys.d.ts +15 -0
- package/module/es5/Object/mapKeys.js +33 -0
- package/module/es5/Object/mapValues.d.ts +15 -0
- package/module/es5/Object/mapValues.js +32 -0
- package/module/es5/Object/mergeDeep.js +7 -10
- package/module/es5/Object/omit.d.ts +1 -1
- package/module/es5/Object/pickDeep.js +4 -6
- package/module/es5/Predicate/every.d.ts +14 -0
- package/module/es5/Predicate/every.js +33 -0
- package/module/es5/Predicate/index.d.ts +6 -0
- package/module/es5/Predicate/index.js +71 -0
- package/module/es5/Predicate/isNotNullish.d.ts +11 -0
- package/module/es5/Predicate/isNotNullish.js +19 -0
- package/module/es5/Predicate/isNullish.d.ts +11 -0
- package/module/es5/Predicate/isNullish.js +19 -0
- package/module/es5/Predicate/matches.d.ts +11 -0
- package/module/es5/Predicate/matches.js +28 -0
- package/module/es5/Predicate/not.d.ts +10 -0
- package/module/es5/Predicate/not.js +20 -0
- package/module/es5/Predicate/some.d.ts +15 -0
- package/module/es5/Predicate/some.js +34 -0
- package/module/es5/String/camelCase.js +2 -2
- package/module/es5/String/escapeHtml.js +1 -1
- package/module/es5/String/formatString/getValue.js +1 -1
- package/module/es5/String/fromBase64.d.ts +0 -1
- package/module/es5/String/fromBase64.js +9 -8
- package/module/es5/String/fuzzySearch.js +84 -9
- package/module/es5/String/kebabCase.js +1 -1
- package/module/es5/String/levenshteinDistance.js +3 -2
- package/module/es5/String/randomString.js +24 -2
- package/module/es5/String/reverseString.js +7 -1
- package/module/es5/String/slugify.js +1 -1
- package/module/es5/String/toHalfWidth.js +2 -2
- package/module/es5/String/truncate.js +0 -3
- package/module/es5/String/unescapeHtml.js +1 -1
- package/module/es5/Time/convertTime.js +4 -3
- package/module/es5/Tool/escapeRegExp.d.ts +8 -0
- package/module/es5/Tool/escapeRegExp.js +18 -0
- package/module/es5/Tool/index.d.ts +1 -0
- package/module/es5/Tool/index.js +11 -0
- package/module/es5/URL/buildUrl.d.ts +17 -0
- package/module/es5/URL/buildUrl.js +31 -0
- package/module/es5/URL/index.d.ts +4 -0
- package/module/es5/URL/index.js +49 -0
- package/module/es5/URL/isAbsoluteUrl.d.ts +20 -0
- package/module/es5/URL/isAbsoluteUrl.js +28 -0
- package/module/es5/URL/joinPath.d.ts +24 -0
- package/module/es5/URL/joinPath.js +48 -0
- package/module/es5/URL/parseQueryString.d.ts +22 -0
- package/module/es5/URL/parseQueryString.js +57 -0
- package/module/es5/Validate/parseEmail.js +5 -5
- package/module/es5/index.d.ts +5 -0
- package/module/es5/index.js +73 -18
- package/module/es5/tsconfig.tsbuildinfo +1 -1
- package/module/index.d.ts +5 -0
- package/module/index.js +5 -0
- package/module/index.js.map +1 -1
- package/package.json +58 -27
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.throttle = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* A throttled function with a cancel method.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates a throttled version of the provided function that only
|
|
13
|
+
* invokes it at most once per the specified wait period.
|
|
14
|
+
*
|
|
15
|
+
* @param function_ - The function to throttle.
|
|
16
|
+
* @param wait - The minimum time between invocations in milliseconds.
|
|
17
|
+
* @returns The throttled function with a cancel method.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const throttled = throttle(() => console.log("called"), 300);
|
|
22
|
+
* throttled();
|
|
23
|
+
* throttled();
|
|
24
|
+
* throttled.cancel();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
var throttle = exports.throttle = function throttle(function_, wait) {
|
|
28
|
+
var lastCallTime = 0;
|
|
29
|
+
var timerId;
|
|
30
|
+
var lastContext;
|
|
31
|
+
var invoke = function invoke() {
|
|
32
|
+
lastCallTime = Date.now();
|
|
33
|
+
var context = lastContext;
|
|
34
|
+
function_.apply(context.thisArg, context.arguments_);
|
|
35
|
+
lastContext = undefined;
|
|
36
|
+
};
|
|
37
|
+
var throttled = function throttled() {
|
|
38
|
+
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
39
|
+
arguments_[_key] = arguments[_key];
|
|
40
|
+
}
|
|
41
|
+
lastContext = {
|
|
42
|
+
arguments_: arguments_,
|
|
43
|
+
thisArg: this
|
|
44
|
+
};
|
|
45
|
+
var elapsed = Date.now() - lastCallTime;
|
|
46
|
+
var remaining = wait - elapsed;
|
|
47
|
+
if (remaining <= 0) {
|
|
48
|
+
if (timerId !== undefined) {
|
|
49
|
+
clearTimeout(timerId);
|
|
50
|
+
timerId = undefined;
|
|
51
|
+
}
|
|
52
|
+
invoke();
|
|
53
|
+
} else {
|
|
54
|
+
timerId !== null && timerId !== void 0 ? timerId : timerId = setTimeout(function () {
|
|
55
|
+
timerId = undefined;
|
|
56
|
+
invoke();
|
|
57
|
+
}, remaining);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
throttled.cancel = function () {
|
|
61
|
+
if (timerId !== undefined) {
|
|
62
|
+
clearTimeout(timerId);
|
|
63
|
+
}
|
|
64
|
+
timerId = undefined;
|
|
65
|
+
lastContext = undefined;
|
|
66
|
+
lastCallTime = 0;
|
|
67
|
+
};
|
|
68
|
+
return throttled;
|
|
69
|
+
};
|
|
@@ -8,11 +8,7 @@ exports.cidrToLong = void 0;
|
|
|
8
8
|
* Converts CIDR notation to a subnet mask number
|
|
9
9
|
* @param {number} cidr - CIDR notation (0-32)
|
|
10
10
|
* @returns {number} Subnet mask as a 32-bit number
|
|
11
|
-
* @throws {Error} If CIDR is not between 0 and 32
|
|
12
11
|
*/
|
|
13
12
|
var cidrToLong = exports.cidrToLong = function cidrToLong(cidr) {
|
|
14
|
-
if (!Number.isInteger(cidr) || cidr < 0 || cidr > 32) {
|
|
15
|
-
throw new Error("CIDR must be an integer between 0 and 32");
|
|
16
|
-
}
|
|
17
13
|
return Number.parseInt("1".repeat(cidr).padEnd(32, "0"), 2) >>> 0;
|
|
18
14
|
};
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
* Converts CIDR notation to a subnet mask
|
|
3
3
|
* @param {number} cidr - CIDR notation (0-32)
|
|
4
4
|
* @returns {string} Subnet mask in IPv4 format (e.g., "255.255.255.0")
|
|
5
|
-
* @throws {Error} If CIDR is not between 0 and 32
|
|
6
5
|
*/
|
|
7
6
|
export declare const cidrToSubnetMask: (cidr: number) => string;
|
|
@@ -10,7 +10,6 @@ var _longToIp = require("./longToIp");
|
|
|
10
10
|
* Converts CIDR notation to a subnet mask
|
|
11
11
|
* @param {number} cidr - CIDR notation (0-32)
|
|
12
12
|
* @returns {string} Subnet mask in IPv4 format (e.g., "255.255.255.0")
|
|
13
|
-
* @throws {Error} If CIDR is not between 0 and 32
|
|
14
13
|
*/
|
|
15
14
|
var cidrToSubnetMask = exports.cidrToSubnetMask = function cidrToSubnetMask(cidr) {
|
|
16
15
|
return (0, _longToIp.longToIp)((0, _cidrToLong.cidrToLong)(cidr));
|
|
@@ -3,6 +3,5 @@
|
|
|
3
3
|
* @param {string} ip - IPv4 address (e.g., "192.168.1.1")
|
|
4
4
|
* @param {string} subnetMask - Subnet mask (e.g., "255.255.255.0")
|
|
5
5
|
* @returns {number} Network address as a 32-bit unsigned integer
|
|
6
|
-
* @throws {Error} If IP address or subnet mask is invalid
|
|
7
6
|
*/
|
|
8
7
|
export declare const getNetworkAddress: (ip: string, subnetMask: string) => number;
|
|
@@ -12,37 +12,8 @@ var _subnetMaskToCidr = require("./subnetMaskToCidr");
|
|
|
12
12
|
* @param {string} ip - IPv4 address (e.g., "192.168.1.1")
|
|
13
13
|
* @param {string} subnetMask - Subnet mask (e.g., "255.255.255.0")
|
|
14
14
|
* @returns {number} Network address as a 32-bit unsigned integer
|
|
15
|
-
* @throws {Error} If IP address or subnet mask is invalid
|
|
16
15
|
*/
|
|
17
16
|
var getNetworkAddress = exports.getNetworkAddress = function getNetworkAddress(ip, subnetMask) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
if (!subnetMask) {
|
|
22
|
-
throw new Error("Subnet mask is required");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Validate IP format
|
|
26
|
-
var ipParts = ip.split(".");
|
|
27
|
-
if (ipParts.length !== 4 || !ipParts.every(function (part) {
|
|
28
|
-
var number_ = Number.parseInt(part, 10);
|
|
29
|
-
return !Number.isNaN(number_) && number_ >= 0 && number_ <= 255;
|
|
30
|
-
})) {
|
|
31
|
-
throw new TypeError("Invalid IP address or subnet mask");
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Validate subnet mask format
|
|
35
|
-
var maskParts = subnetMask.split(".");
|
|
36
|
-
if (maskParts.length !== 4 || !maskParts.every(function (part) {
|
|
37
|
-
var number_ = Number.parseInt(part, 10);
|
|
38
|
-
return !Number.isNaN(number_) && number_ >= 0 && number_ <= 255;
|
|
39
|
-
})) {
|
|
40
|
-
throw new TypeError("Invalid IP address or subnet mask");
|
|
41
|
-
}
|
|
42
|
-
try {
|
|
43
|
-
var networkAddress = (0, _ipToLong.ipToLong)(ip) & (0, _cidrToLong.cidrToLong)((0, _subnetMaskToCidr.subnetMaskToCidr)(subnetMask));
|
|
44
|
-
return networkAddress >>> 0; // Convert to unsigned 32-bit integer
|
|
45
|
-
} catch (_unused) {
|
|
46
|
-
throw new TypeError("Invalid IP address or subnet mask");
|
|
47
|
-
}
|
|
17
|
+
var networkAddress = (0, _ipToLong.ipToLong)(ip) & (0, _cidrToLong.cidrToLong)((0, _subnetMaskToCidr.subnetMaskToCidr)(subnetMask));
|
|
18
|
+
return networkAddress >>> 0; // Convert to unsigned 32-bit integer
|
|
48
19
|
};
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
* Converts an IPv4 address to its binary string representation
|
|
3
3
|
* @param {string} ip - IPv4 address (e.g., "192.168.1.1")
|
|
4
4
|
* @returns {string} Binary string representation (32 bits)
|
|
5
|
-
* @throws {Error} If IP address is invalid
|
|
6
5
|
*/
|
|
7
6
|
export declare const ipToBinaryString: (ip: string) => string;
|
|
@@ -4,52 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ipToBinaryString = void 0;
|
|
7
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
8
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
7
|
/**
|
|
11
8
|
* Converts an IPv4 address to its binary string representation
|
|
12
9
|
* @param {string} ip - IPv4 address (e.g., "192.168.1.1")
|
|
13
10
|
* @returns {string} Binary string representation (32 bits)
|
|
14
|
-
* @throws {Error} If IP address is invalid
|
|
15
11
|
*/
|
|
16
12
|
var ipToBinaryString = exports.ipToBinaryString = function ipToBinaryString(ip) {
|
|
17
|
-
|
|
18
|
-
throw new Error("IP address is required");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Check for invalid characters
|
|
22
|
-
if (/[^0-9.]/.test(ip)) {
|
|
23
|
-
throw new Error("Invalid IP address format");
|
|
24
|
-
}
|
|
25
|
-
var parts = ip.split(".");
|
|
26
|
-
if (parts.length !== 4) {
|
|
27
|
-
throw new Error("Invalid IP address format");
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Validate each octet
|
|
31
|
-
var _iterator = _createForOfIteratorHelper(parts),
|
|
32
|
-
_step;
|
|
33
|
-
try {
|
|
34
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
35
|
-
var octet = _step.value;
|
|
36
|
-
// Check for empty octet or leading zeros
|
|
37
|
-
if (!octet || octet.length > 1 && octet.startsWith("0")) {
|
|
38
|
-
throw new Error("Invalid IP address format");
|
|
39
|
-
}
|
|
40
|
-
var number = Number.parseInt(octet, 10);
|
|
41
|
-
if (Number.isNaN(number) || number < 0 || number > 255) {
|
|
42
|
-
throw new Error("Invalid IP address format");
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Convert to binary
|
|
47
|
-
} catch (err) {
|
|
48
|
-
_iterator.e(err);
|
|
49
|
-
} finally {
|
|
50
|
-
_iterator.f();
|
|
51
|
-
}
|
|
52
|
-
return parts.map(function (octet) {
|
|
13
|
+
return ip.split(".").map(function (octet) {
|
|
53
14
|
return Number.parseInt(octet, 10).toString(2).padStart(8, "0");
|
|
54
15
|
}).join("");
|
|
55
16
|
};
|
|
@@ -9,7 +9,6 @@ var _ipToBinaryString = require("./ipToBinaryString");
|
|
|
9
9
|
* Converts an IPv4 address to a 32-bit number
|
|
10
10
|
* @param {string} ip - IPv4 address to convert (e.g., "192.168.1.1")
|
|
11
11
|
* @returns {number} 32-bit unsigned integer
|
|
12
|
-
* @throws {Error} If IP address is invalid
|
|
13
12
|
*/
|
|
14
13
|
var ipToLong = exports.ipToLong = function ipToLong(ip) {
|
|
15
14
|
return Number.parseInt((0, _ipToBinaryString.ipToBinaryString)(ip), 2) >>> 0;
|
|
@@ -4,6 +4,5 @@
|
|
|
4
4
|
* @param {string} networkIp - Network IP address (e.g., "192.168.0.0")
|
|
5
5
|
* @param {number} cidr - CIDR notation (0-32)
|
|
6
6
|
* @returns {boolean} True if the IP is in range, false otherwise
|
|
7
|
-
* @throws {Error} If any parameter is invalid
|
|
8
7
|
*/
|
|
9
8
|
export declare const isInRange: (remoteIp: string, networkIp: string, cidr: number) => boolean;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isInRange = void 0;
|
|
7
|
+
var _cidrToLong = require("./cidrToLong");
|
|
7
8
|
var _ipToLong = require("./ipToLong");
|
|
8
9
|
/**
|
|
9
10
|
* Checks if an IP address is within a specified network range
|
|
@@ -11,35 +12,10 @@ var _ipToLong = require("./ipToLong");
|
|
|
11
12
|
* @param {string} networkIp - Network IP address (e.g., "192.168.0.0")
|
|
12
13
|
* @param {number} cidr - CIDR notation (0-32)
|
|
13
14
|
* @returns {boolean} True if the IP is in range, false otherwise
|
|
14
|
-
* @throws {Error} If any parameter is invalid
|
|
15
15
|
*/
|
|
16
16
|
var isInRange = exports.isInRange = function isInRange(remoteIp, networkIp, cidr) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
throw new Error("Network IP address is required");
|
|
22
|
-
}
|
|
23
|
-
if (!Number.isInteger(cidr) || cidr < 0 || cidr > 32) {
|
|
24
|
-
throw new Error("CIDR must be an integer between 0 and 32");
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
var remoteLong = (0, _ipToLong.ipToLong)(remoteIp);
|
|
28
|
-
var networkLong = (0, _ipToLong.ipToLong)(networkIp);
|
|
29
|
-
|
|
30
|
-
// Special cases
|
|
31
|
-
if (cidr === 0) {
|
|
32
|
-
return true; // All IPs are in range
|
|
33
|
-
}
|
|
34
|
-
if (cidr === 32) {
|
|
35
|
-
return remoteLong === networkLong; // Exact match required
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Normal case
|
|
39
|
-
var shift = 32 - cidr;
|
|
40
|
-
var mask = 0xffffffff >>> 0 << shift;
|
|
41
|
-
return (remoteLong & mask) === (networkLong & mask);
|
|
42
|
-
} catch (error) {
|
|
43
|
-
throw new Error("Invalid IP address format: ".concat(String(error)));
|
|
44
|
-
}
|
|
17
|
+
var remoteLong = (0, _ipToLong.ipToLong)(remoteIp);
|
|
18
|
+
var networkLong = (0, _ipToLong.ipToLong)(networkIp);
|
|
19
|
+
var mask = (0, _cidrToLong.cidrToLong)(cidr);
|
|
20
|
+
return (remoteLong & mask) === (networkLong & mask);
|
|
45
21
|
};
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
* Checks if an IP address is within private IP ranges
|
|
3
3
|
* @param {string} ip - IP address to check (e.g., "192.168.1.1")
|
|
4
4
|
* @returns {boolean} True if the IP is private, false otherwise
|
|
5
|
-
* @throws {Error} If IP address is invalid
|
|
6
5
|
*/
|
|
7
6
|
export declare const isPrivateIp: (ip: string) => boolean;
|
|
@@ -9,13 +9,8 @@ var _isInRange = require("./isInRange");
|
|
|
9
9
|
* Checks if an IP address is within private IP ranges
|
|
10
10
|
* @param {string} ip - IP address to check (e.g., "192.168.1.1")
|
|
11
11
|
* @returns {boolean} True if the IP is private, false otherwise
|
|
12
|
-
* @throws {Error} If IP address is invalid
|
|
13
12
|
*/
|
|
14
13
|
var isPrivateIp = exports.isPrivateIp = function isPrivateIp(ip) {
|
|
15
|
-
if (!ip) {
|
|
16
|
-
throw new Error("IP address is required");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
14
|
// Define private IP ranges with their CIDR notations
|
|
20
15
|
var privateRanges = [{
|
|
21
16
|
network: "10.0.0.0",
|
|
@@ -32,11 +27,7 @@ var isPrivateIp = exports.isPrivateIp = function isPrivateIp(ip) {
|
|
|
32
27
|
cidr: 16
|
|
33
28
|
} // Class C private network
|
|
34
29
|
];
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
} catch (error) {
|
|
40
|
-
throw new Error("Invalid IP address: ".concat(String(error)));
|
|
41
|
-
}
|
|
30
|
+
return privateRanges.some(function (range) {
|
|
31
|
+
return (0, _isInRange.isInRange)(ip, range.network, range.cidr);
|
|
32
|
+
});
|
|
42
33
|
};
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
* Converts a 32-bit number to an IPv4 address
|
|
3
3
|
* @param {number} long - 32-bit unsigned integer to convert
|
|
4
4
|
* @returns {string} IPv4 address (e.g., "192.168.1.1")
|
|
5
|
-
* @throws {Error} If input is not a valid 32-bit unsigned integer
|
|
6
5
|
*/
|
|
7
6
|
export declare const longToIp: (long: number) => string;
|
|
@@ -8,14 +8,8 @@ exports.longToIp = void 0;
|
|
|
8
8
|
* Converts a 32-bit number to an IPv4 address
|
|
9
9
|
* @param {number} long - 32-bit unsigned integer to convert
|
|
10
10
|
* @returns {string} IPv4 address (e.g., "192.168.1.1")
|
|
11
|
-
* @throws {Error} If input is not a valid 32-bit unsigned integer
|
|
12
11
|
*/
|
|
13
12
|
var longToIp = exports.longToIp = function longToIp(_long) {
|
|
14
|
-
// Validate input
|
|
15
|
-
if (!Number.isFinite(_long) || _long < 0 || _long > 0xffffffff || !Number.isInteger(_long)) {
|
|
16
|
-
throw new Error("Input must be a valid 32-bit unsigned integer");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
13
|
// Convert to binary string and ensure 32-bit length
|
|
20
14
|
var binary = _long.toString(2).padStart(32, "0");
|
|
21
15
|
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
* Converts a subnet mask to CIDR notation
|
|
3
3
|
* @param {string} subnetMask - IPv4 subnet mask (e.g., "255.255.255.0")
|
|
4
4
|
* @returns {number} CIDR notation (0-32)
|
|
5
|
-
* @throws {Error} If subnet mask is invalid
|
|
6
5
|
*/
|
|
7
6
|
export declare const subnetMaskToCidr: (subnetMask: string) => number;
|
|
@@ -4,39 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.subnetMaskToCidr = void 0;
|
|
7
|
+
var _ipToBinaryString = require("./ipToBinaryString");
|
|
7
8
|
/**
|
|
8
9
|
* Converts a subnet mask to CIDR notation
|
|
9
10
|
* @param {string} subnetMask - IPv4 subnet mask (e.g., "255.255.255.0")
|
|
10
11
|
* @returns {number} CIDR notation (0-32)
|
|
11
|
-
* @throws {Error} If subnet mask is invalid
|
|
12
12
|
*/
|
|
13
13
|
var subnetMaskToCidr = exports.subnetMaskToCidr = function subnetMaskToCidr(subnetMask) {
|
|
14
14
|
var _binaryString$match$l, _binaryString$match;
|
|
15
|
-
|
|
16
|
-
throw new Error("Subnet mask is required");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Parse octets and validate format
|
|
20
|
-
var octets = subnetMask.split(".");
|
|
21
|
-
if (octets.length !== 4) {
|
|
22
|
-
throw new Error("Invalid subnet mask format");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Validate each octet
|
|
26
|
-
var binaryOctets = octets.map(function (octet) {
|
|
27
|
-
var number_ = Number.parseInt(octet, 10);
|
|
28
|
-
if (Number.isNaN(number_) || number_ < 0 || number_ > 255) {
|
|
29
|
-
throw new Error("Invalid subnet mask format");
|
|
30
|
-
}
|
|
31
|
-
return number_.toString(2).padStart(8, "0");
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// Join octets and count consecutive 1s
|
|
35
|
-
var binaryString = binaryOctets.join("");
|
|
36
|
-
var match = /^1*0*$/.exec(binaryString);
|
|
37
|
-
if (!match) {
|
|
38
|
-
throw new Error("Invalid subnet mask: must be consecutive 1s followed by 0s");
|
|
39
|
-
}
|
|
15
|
+
var binaryString = (0, _ipToBinaryString.ipToBinaryString)(subnetMask);
|
|
40
16
|
|
|
41
17
|
// Count 1s
|
|
42
18
|
var cidr = (_binaryString$match$l = (_binaryString$match = binaryString.match(/1/g)) === null || _binaryString$match === void 0 ? void 0 : _binaryString$match.length) !== null && _binaryString$match$l !== void 0 ? _binaryString$match$l : 0;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _lazyFilter = require("./lazyFilter");
|
|
7
|
+
Object.keys(_lazyFilter).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _lazyFilter[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _lazyFilter[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _lazyMap = require("./lazyMap");
|
|
18
|
+
Object.keys(_lazyMap).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _lazyMap[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _lazyMap[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _lazyTake = require("./lazyTake");
|
|
29
|
+
Object.keys(_lazyTake).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _lazyTake[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _lazyTake[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazily filters values from an iterable using a generator
|
|
3
|
+
* @param {Iterable<T>} iterable - The source iterable
|
|
4
|
+
* @param {(value: T, index: number) => boolean} predicate - The filter predicate
|
|
5
|
+
* @returns {Generator<T, void, undefined>} A generator yielding filtered values
|
|
6
|
+
* @example
|
|
7
|
+
* const evens = lazyFilter([1, 2, 3, 4], (n) => n % 2 === 0);
|
|
8
|
+
* [...evens]; // [2, 4]
|
|
9
|
+
*/
|
|
10
|
+
export declare function lazyFilter<T>(iterable: Iterable<T>, predicate: (value: T, index: number) => boolean): Generator<T, void, undefined>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.lazyFilter = lazyFilter;
|
|
7
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
8
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
9
|
+
var _marked = /*#__PURE__*/_regenerator().m(lazyFilter);
|
|
10
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
+
/**
|
|
14
|
+
* Lazily filters values from an iterable using a generator
|
|
15
|
+
* @param {Iterable<T>} iterable - The source iterable
|
|
16
|
+
* @param {(value: T, index: number) => boolean} predicate - The filter predicate
|
|
17
|
+
* @returns {Generator<T, void, undefined>} A generator yielding filtered values
|
|
18
|
+
* @example
|
|
19
|
+
* const evens = lazyFilter([1, 2, 3, 4], (n) => n % 2 === 0);
|
|
20
|
+
* [...evens]; // [2, 4]
|
|
21
|
+
*/
|
|
22
|
+
function lazyFilter(iterable, predicate) {
|
|
23
|
+
var index, _iterator, _step, value, _t;
|
|
24
|
+
return _regenerator().w(function (_context) {
|
|
25
|
+
while (1) switch (_context.p = _context.n) {
|
|
26
|
+
case 0:
|
|
27
|
+
index = 0;
|
|
28
|
+
_iterator = _createForOfIteratorHelper(iterable);
|
|
29
|
+
_context.p = 1;
|
|
30
|
+
_iterator.s();
|
|
31
|
+
case 2:
|
|
32
|
+
if ((_step = _iterator.n()).done) {
|
|
33
|
+
_context.n = 5;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
value = _step.value;
|
|
37
|
+
if (!predicate(value, index)) {
|
|
38
|
+
_context.n = 3;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
_context.n = 3;
|
|
42
|
+
return value;
|
|
43
|
+
case 3:
|
|
44
|
+
index += 1;
|
|
45
|
+
case 4:
|
|
46
|
+
_context.n = 2;
|
|
47
|
+
break;
|
|
48
|
+
case 5:
|
|
49
|
+
_context.n = 7;
|
|
50
|
+
break;
|
|
51
|
+
case 6:
|
|
52
|
+
_context.p = 6;
|
|
53
|
+
_t = _context.v;
|
|
54
|
+
_iterator.e(_t);
|
|
55
|
+
case 7:
|
|
56
|
+
_context.p = 7;
|
|
57
|
+
_iterator.f();
|
|
58
|
+
return _context.f(7);
|
|
59
|
+
case 8:
|
|
60
|
+
return _context.a(2);
|
|
61
|
+
}
|
|
62
|
+
}, _marked, null, [[1, 6, 7, 8]]);
|
|
63
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazily maps values from an iterable using a generator
|
|
3
|
+
* @param {Iterable<T>} iterable - The source iterable
|
|
4
|
+
* @param {(value: T, index: number) => U} function_ - The mapping function
|
|
5
|
+
* @returns {Generator<U, void, undefined>} A generator yielding mapped values
|
|
6
|
+
* @example
|
|
7
|
+
* const doubled = lazyMap([1, 2, 3], (n) => n * 2);
|
|
8
|
+
* [...doubled]; // [2, 4, 6]
|
|
9
|
+
*/
|
|
10
|
+
export declare function lazyMap<T, U>(iterable: Iterable<T>, function_: (value: T, index: number) => U): Generator<U, void, undefined>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.lazyMap = lazyMap;
|
|
7
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
8
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
9
|
+
var _marked = /*#__PURE__*/_regenerator().m(lazyMap);
|
|
10
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
+
/**
|
|
14
|
+
* Lazily maps values from an iterable using a generator
|
|
15
|
+
* @param {Iterable<T>} iterable - The source iterable
|
|
16
|
+
* @param {(value: T, index: number) => U} function_ - The mapping function
|
|
17
|
+
* @returns {Generator<U, void, undefined>} A generator yielding mapped values
|
|
18
|
+
* @example
|
|
19
|
+
* const doubled = lazyMap([1, 2, 3], (n) => n * 2);
|
|
20
|
+
* [...doubled]; // [2, 4, 6]
|
|
21
|
+
*/
|
|
22
|
+
function lazyMap(iterable, function_) {
|
|
23
|
+
var index, _iterator, _step, value, _t;
|
|
24
|
+
return _regenerator().w(function (_context) {
|
|
25
|
+
while (1) switch (_context.p = _context.n) {
|
|
26
|
+
case 0:
|
|
27
|
+
index = 0;
|
|
28
|
+
_iterator = _createForOfIteratorHelper(iterable);
|
|
29
|
+
_context.p = 1;
|
|
30
|
+
_iterator.s();
|
|
31
|
+
case 2:
|
|
32
|
+
if ((_step = _iterator.n()).done) {
|
|
33
|
+
_context.n = 5;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
value = _step.value;
|
|
37
|
+
_context.n = 3;
|
|
38
|
+
return function_(value, index);
|
|
39
|
+
case 3:
|
|
40
|
+
index += 1;
|
|
41
|
+
case 4:
|
|
42
|
+
_context.n = 2;
|
|
43
|
+
break;
|
|
44
|
+
case 5:
|
|
45
|
+
_context.n = 7;
|
|
46
|
+
break;
|
|
47
|
+
case 6:
|
|
48
|
+
_context.p = 6;
|
|
49
|
+
_t = _context.v;
|
|
50
|
+
_iterator.e(_t);
|
|
51
|
+
case 7:
|
|
52
|
+
_context.p = 7;
|
|
53
|
+
_iterator.f();
|
|
54
|
+
return _context.f(7);
|
|
55
|
+
case 8:
|
|
56
|
+
return _context.a(2);
|
|
57
|
+
}
|
|
58
|
+
}, _marked, null, [[1, 6, 7, 8]]);
|
|
59
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazily takes the first n values from an iterable
|
|
3
|
+
* @param {Iterable<T>} iterable - The source iterable
|
|
4
|
+
* @param {number} n - The number of values to take
|
|
5
|
+
* @returns {Generator<T, void, undefined>} A generator yielding at most n values
|
|
6
|
+
* @example
|
|
7
|
+
* const first3 = lazyTake([1, 2, 3, 4, 5], 3);
|
|
8
|
+
* [...first3]; // [1, 2, 3]
|
|
9
|
+
*/
|
|
10
|
+
export declare function lazyTake<T>(iterable: Iterable<T>, n: number): Generator<T, void, undefined>;
|