umt 2.12.2 → 2.13.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 +206 -133
- 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 +2 -4
- package/module/Crypto/decodeBase32.js.map +1 -1
- package/module/Crypto/decodeBase58.js +2 -4
- 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 +2 -1
- 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 +62 -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 +221 -207
- 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 +2 -4
- package/module/es5/Crypto/decodeBase58.js +2 -4
- package/module/es5/Crypto/encodeBase32.js +2 -1
- package/module/es5/Crypto/encodeBase58.js +2 -1
- 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 +107 -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 +25 -20
- package/module/es5/index.js +135 -80
- package/module/es5/tsconfig.tsbuildinfo +1 -1
- package/module/index.d.ts +25 -20
- package/module/index.js +25 -20
- package/module/index.js.map +1 -1
- package/package.json +43 -17
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Represents a successful execution result containing a value
|
|
3
3
|
* @template V The type of the success value
|
|
4
4
|
*/
|
|
5
|
-
interface SuccessType<V> {
|
|
5
|
+
export interface SuccessType<V> {
|
|
6
6
|
type: "success";
|
|
7
7
|
value: V;
|
|
8
8
|
}
|
|
@@ -10,7 +10,7 @@ interface SuccessType<V> {
|
|
|
10
10
|
* Represents an error result containing an error object
|
|
11
11
|
* @template E The type of the error
|
|
12
12
|
*/
|
|
13
|
-
interface ErrorType<E> {
|
|
13
|
+
export interface ErrorType<E> {
|
|
14
14
|
type: "error";
|
|
15
15
|
error: E;
|
|
16
16
|
}
|
|
@@ -20,6 +20,20 @@ interface ErrorType<E> {
|
|
|
20
20
|
* @template E The type of the error
|
|
21
21
|
*/
|
|
22
22
|
export type Result<V, E> = SuccessType<V> | ErrorType<E>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates an error result
|
|
25
|
+
* @template E The type of the error
|
|
26
|
+
* @param error The error object
|
|
27
|
+
* @returns An ErrorType containing the error
|
|
28
|
+
*/
|
|
29
|
+
export declare const errorFunction: <E>(error: E) => ErrorType<E>;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a success result
|
|
32
|
+
* @template V The type of the success value
|
|
33
|
+
* @param value The success value
|
|
34
|
+
* @returns A SuccessType containing the value
|
|
35
|
+
*/
|
|
36
|
+
export declare const successFunction: <V>(value: V) => SuccessType<V>;
|
|
23
37
|
/**
|
|
24
38
|
* Safely executes a callback function and returns a Result type
|
|
25
39
|
* Catches any errors and wraps them in a Result type
|
|
@@ -29,4 +43,3 @@ export type Result<V, E> = SuccessType<V> | ErrorType<E>;
|
|
|
29
43
|
* @returns A Result containing either the successful value or the caught error
|
|
30
44
|
*/
|
|
31
45
|
export declare const safeExecute: <V, E = Error>(callback: () => V) => Result<V, E>;
|
|
32
|
-
export {};
|
|
@@ -4,14 +4,17 @@
|
|
|
4
4
|
* @param error The error object
|
|
5
5
|
* @returns An ErrorType containing the error
|
|
6
6
|
*/
|
|
7
|
-
const errorFunction = (error) => ({
|
|
7
|
+
export const errorFunction = (error) => ({
|
|
8
|
+
type: "error",
|
|
9
|
+
error,
|
|
10
|
+
});
|
|
8
11
|
/**
|
|
9
12
|
* Creates a success result
|
|
10
13
|
* @template V The type of the success value
|
|
11
14
|
* @param value The success value
|
|
12
15
|
* @returns A SuccessType containing the value
|
|
13
16
|
*/
|
|
14
|
-
const successFunction = (value) => ({
|
|
17
|
+
export const successFunction = (value) => ({
|
|
15
18
|
type: "success",
|
|
16
19
|
value,
|
|
17
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeExecute.js","sourceRoot":"","sources":["../../src/Error/safeExecute.ts"],"names":[],"mappings":"AAwBA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAI,KAAQ,EAAgB,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"safeExecute.js","sourceRoot":"","sources":["../../src/Error/safeExecute.ts"],"names":[],"mappings":"AAwBA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,KAAQ,EAAgB,EAAE,CAAC,CAAC;IAC3D,IAAI,EAAE,OAAO;IACb,KAAK;CACN,CAAC,CAAC;AACH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,KAAQ,EAAkB,EAAE,CAAC,CAAC;IAC/D,IAAI,EAAE,SAAS;IACf,KAAK;CACN,CAAC,CAAC;AACH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAe,QAAiB,EAAgB,EAAE;IAC3E,IAAI,CAAC;QACH,OAAO,eAAe,CAAI,QAAQ,EAAE,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,aAAa,CAAI,KAAU,CAAC,CAAC;IACtC,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the debounce function.
|
|
3
|
+
*/
|
|
4
|
+
export interface DebounceOptions {
|
|
5
|
+
/** Whether to invoke on the leading edge of the timeout. */
|
|
6
|
+
leading?: boolean;
|
|
7
|
+
/** Whether to invoke on the trailing edge of the timeout. */
|
|
8
|
+
trailing?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A debounced function with a cancel method.
|
|
12
|
+
*/
|
|
13
|
+
export interface DebouncedFunction<T extends (...arguments_: unknown[]) => unknown> {
|
|
14
|
+
(...arguments_: Parameters<T>): void;
|
|
15
|
+
/** Cancels any pending debounced invocation. */
|
|
16
|
+
cancel: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates a debounced version of the provided function that delays
|
|
20
|
+
* invoking it until after the specified wait time has elapsed since
|
|
21
|
+
* the last time the debounced function was called.
|
|
22
|
+
*
|
|
23
|
+
* @param function_ - The function to debounce.
|
|
24
|
+
* @param wait - The number of milliseconds to delay.
|
|
25
|
+
* @param options - Configuration for leading/trailing invocation.
|
|
26
|
+
* @param options.leading - If true, invoke on the leading edge.
|
|
27
|
+
* @param options.trailing - If true, invoke on the trailing edge (default).
|
|
28
|
+
* @returns The debounced function with a cancel method.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const debounced = debounce(() => console.log("called"), 300);
|
|
33
|
+
* debounced();
|
|
34
|
+
* debounced();
|
|
35
|
+
* debounced.cancel();
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare const debounce: <T extends (...arguments_: unknown[]) => unknown>(function_: T, wait: number, options?: DebounceOptions) => DebouncedFunction<T>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a debounced version of the provided function that delays
|
|
3
|
+
* invoking it until after the specified wait time has elapsed since
|
|
4
|
+
* the last time the debounced function was called.
|
|
5
|
+
*
|
|
6
|
+
* @param function_ - The function to debounce.
|
|
7
|
+
* @param wait - The number of milliseconds to delay.
|
|
8
|
+
* @param options - Configuration for leading/trailing invocation.
|
|
9
|
+
* @param options.leading - If true, invoke on the leading edge.
|
|
10
|
+
* @param options.trailing - If true, invoke on the trailing edge (default).
|
|
11
|
+
* @returns The debounced function with a cancel method.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const debounced = debounce(() => console.log("called"), 300);
|
|
16
|
+
* debounced();
|
|
17
|
+
* debounced();
|
|
18
|
+
* debounced.cancel();
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export const debounce = (function_, wait, options = {}) => {
|
|
22
|
+
const { leading = false, trailing = true } = options;
|
|
23
|
+
let timerId;
|
|
24
|
+
let lastArguments;
|
|
25
|
+
const thisReference = { value: undefined };
|
|
26
|
+
let lastCallTime = 0;
|
|
27
|
+
const scheduleCheck = () => {
|
|
28
|
+
timerId = setTimeout(() => {
|
|
29
|
+
const elapsed = Date.now() - lastCallTime;
|
|
30
|
+
const remaining = wait - elapsed;
|
|
31
|
+
if (remaining <= 0) {
|
|
32
|
+
timerId = undefined;
|
|
33
|
+
if (trailing && lastArguments !== undefined) {
|
|
34
|
+
function_.apply(thisReference.value, lastArguments);
|
|
35
|
+
lastArguments = undefined;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
scheduleCheck();
|
|
40
|
+
}
|
|
41
|
+
}, wait - (Date.now() - lastCallTime));
|
|
42
|
+
};
|
|
43
|
+
const debounced = function (...arguments_) {
|
|
44
|
+
lastArguments = arguments_;
|
|
45
|
+
thisReference.value = this;
|
|
46
|
+
lastCallTime = Date.now();
|
|
47
|
+
const isFirstCall = timerId === undefined;
|
|
48
|
+
if (leading && isFirstCall) {
|
|
49
|
+
function_.apply(thisReference.value, lastArguments);
|
|
50
|
+
lastArguments = undefined;
|
|
51
|
+
}
|
|
52
|
+
if (isFirstCall) {
|
|
53
|
+
scheduleCheck();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
debounced.cancel = () => {
|
|
57
|
+
if (timerId !== undefined) {
|
|
58
|
+
clearTimeout(timerId);
|
|
59
|
+
}
|
|
60
|
+
timerId = undefined;
|
|
61
|
+
lastArguments = undefined;
|
|
62
|
+
thisReference.value = undefined;
|
|
63
|
+
lastCallTime = 0;
|
|
64
|
+
};
|
|
65
|
+
return debounced;
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=debounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../src/Function/debounce.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,SAAY,EACZ,IAAY,EACZ,UAA2B,EAAE,EACP,EAAE;IACxB,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IACrD,IAAI,OAAkD,CAAC;IACvD,IAAI,aAAwC,CAAC;IAC7C,MAAM,aAAa,GAAG,EAAE,KAAK,EAAE,SAAoB,EAAE,CAAC;IACtD,IAAI,YAAY,GAAG,CAAC,CAAC;IAErB,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,OAAO,GAAG,UAAU,CAClB,GAAG,EAAE;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC;YAC1C,MAAM,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC;YACjC,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;gBACnB,OAAO,GAAG,SAAS,CAAC;gBACpB,IAAI,QAAQ,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;oBAC5C,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;oBACpD,aAAa,GAAG,SAAS,CAAC;gBAC5B,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,aAAa,EAAE,CAAC;YAClB,CAAC;QACH,CAAC,EACD,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,CACnC,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,UAEhB,GAAG,UAAyB;QAE5B,aAAa,GAAG,UAAU,CAAC;QAC3B,aAAa,CAAC,KAAK,GAAG,IAAI,CAAC;QAC3B,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE1B,MAAM,WAAW,GAAG,OAAO,KAAK,SAAS,CAAC;QAE1C,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC;YAC3B,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;YACpD,aAAa,GAAG,SAAS,CAAC;QAC5B,CAAC;QAED,IAAI,WAAW,EAAE,CAAC;YAChB,aAAa,EAAE,CAAC;QAClB,CAAC;IACH,CAAyB,CAAC;IAE1B,SAAS,CAAC,MAAM,GAAG,GAAG,EAAE;QACtB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,GAAG,SAAS,CAAC;QACpB,aAAa,GAAG,SAAS,CAAC;QAC1B,aAAa,CAAC,KAAK,GAAG,SAAS,CAAC;QAChC,YAAY,GAAG,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
package/module/Function/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Function/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Function/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the memoize function.
|
|
3
|
+
*/
|
|
4
|
+
export interface MemoizeOptions<K> {
|
|
5
|
+
/** Maximum number of entries to store in the cache. */
|
|
6
|
+
maxSize?: number;
|
|
7
|
+
/** Custom function to generate cache keys from arguments. */
|
|
8
|
+
resolver?: (...arguments_: unknown[]) => K;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A memoized function with an exposed cache.
|
|
12
|
+
*/
|
|
13
|
+
export interface MemoizedFunction<A extends unknown[], R, K = unknown> {
|
|
14
|
+
(...arguments_: A): R;
|
|
15
|
+
/** The underlying cache Map. */
|
|
16
|
+
cache: Map<K, R>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates a memoized version of the provided function. Results are
|
|
20
|
+
* cached in a Map keyed by the first argument (or a custom resolver).
|
|
21
|
+
*
|
|
22
|
+
* @param function_ - The function to memoize.
|
|
23
|
+
* @param options - Configuration for cache behavior.
|
|
24
|
+
* @param options.maxSize - Maximum cache entries before evicting the oldest.
|
|
25
|
+
* @param options.resolver - Custom key resolver function.
|
|
26
|
+
* @returns The memoized function with an exposed cache property.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const memoized = memoize((n: number) => n * 2);
|
|
31
|
+
* memoized(5); // 10 (computed)
|
|
32
|
+
* memoized(5); // 10 (cached)
|
|
33
|
+
* memoized.cache.size; // 1
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const memoize: <A extends unknown[], R, K = unknown>(function_: (...arguments_: A) => R, options?: MemoizeOptions<K>) => MemoizedFunction<A, R, K>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a memoized version of the provided function. Results are
|
|
3
|
+
* cached in a Map keyed by the first argument (or a custom resolver).
|
|
4
|
+
*
|
|
5
|
+
* @param function_ - The function to memoize.
|
|
6
|
+
* @param options - Configuration for cache behavior.
|
|
7
|
+
* @param options.maxSize - Maximum cache entries before evicting the oldest.
|
|
8
|
+
* @param options.resolver - Custom key resolver function.
|
|
9
|
+
* @returns The memoized function with an exposed cache property.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const memoized = memoize((n: number) => n * 2);
|
|
14
|
+
* memoized(5); // 10 (computed)
|
|
15
|
+
* memoized(5); // 10 (cached)
|
|
16
|
+
* memoized.cache.size; // 1
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export const memoize = (function_, options = {}) => {
|
|
20
|
+
const { maxSize, resolver } = options;
|
|
21
|
+
const cache = new Map();
|
|
22
|
+
const memoized = (resolver
|
|
23
|
+
? function (...arguments_) {
|
|
24
|
+
const key = resolver(...arguments_);
|
|
25
|
+
const cached = cache.get(key);
|
|
26
|
+
if (cached !== undefined) {
|
|
27
|
+
return cached;
|
|
28
|
+
}
|
|
29
|
+
const result = function_.apply(this, arguments_);
|
|
30
|
+
if (maxSize !== undefined && cache.size >= maxSize) {
|
|
31
|
+
const firstKey = cache.keys().next().value;
|
|
32
|
+
cache.delete(firstKey);
|
|
33
|
+
}
|
|
34
|
+
cache.set(key, result);
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
: function (...arguments_) {
|
|
38
|
+
const key = arguments_[0];
|
|
39
|
+
const cached = cache.get(key);
|
|
40
|
+
if (cached !== undefined) {
|
|
41
|
+
return cached;
|
|
42
|
+
}
|
|
43
|
+
const result = function_.apply(this, arguments_);
|
|
44
|
+
if (maxSize !== undefined && cache.size >= maxSize) {
|
|
45
|
+
const firstKey = cache.keys().next().value;
|
|
46
|
+
cache.delete(firstKey);
|
|
47
|
+
}
|
|
48
|
+
cache.set(key, result);
|
|
49
|
+
return result;
|
|
50
|
+
});
|
|
51
|
+
memoized.cache = cache;
|
|
52
|
+
return memoized;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=memoize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memoize.js","sourceRoot":"","sources":["../../src/Function/memoize.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,SAAkC,EAClC,UAA6B,EAAE,EACJ,EAAE;IAC7B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACtC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAQ,CAAC;IAE9B,MAAM,QAAQ,GAAG,CACf,QAAQ;QACN,CAAC,CAAC,UAAyB,GAAG,UAAa;YACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,UAAU,CAAC,CAAC;YACpC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,OAAO,MAAM,CAAC;YAChB,CAAC;YACD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YACjD,IAAI,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;gBACnD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAU,CAAC;gBAChD,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC;YACD,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YACvB,OAAO,MAAM,CAAC;QAChB,CAAC;QACH,CAAC,CAAC,UAAyB,GAAG,UAAa;YACvC,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAM,CAAC;YAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,OAAO,MAAM,CAAC;YAChB,CAAC;YACD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YACjD,IAAI,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;gBACnD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAU,CAAC;gBAChD,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC;YACD,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YACvB,OAAO,MAAM,CAAC;QAChB,CAAC,CACuB,CAAC;IAE/B,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IAEvB,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a function that is restricted to be called only once.
|
|
3
|
+
* Subsequent calls return the result of the first invocation.
|
|
4
|
+
*
|
|
5
|
+
* @param function_ - The function to restrict.
|
|
6
|
+
* @returns A function that invokes the original only on its first call.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const initialize = once(() => {
|
|
11
|
+
* console.log("initialized");
|
|
12
|
+
* return 42;
|
|
13
|
+
* });
|
|
14
|
+
* initialize(); // logs "initialized", returns 42
|
|
15
|
+
* initialize(); // returns 42 (no log)
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const once: <A extends unknown[], R>(function_: (...arguments_: A) => R) => ((...arguments_: A) => R);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a function that is restricted to be called only once.
|
|
3
|
+
* Subsequent calls return the result of the first invocation.
|
|
4
|
+
*
|
|
5
|
+
* @param function_ - The function to restrict.
|
|
6
|
+
* @returns A function that invokes the original only on its first call.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const initialize = once(() => {
|
|
11
|
+
* console.log("initialized");
|
|
12
|
+
* return 42;
|
|
13
|
+
* });
|
|
14
|
+
* initialize(); // logs "initialized", returns 42
|
|
15
|
+
* initialize(); // returns 42 (no log)
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export const once = (function_) => {
|
|
19
|
+
let called = false;
|
|
20
|
+
let result;
|
|
21
|
+
return function (...arguments_) {
|
|
22
|
+
if (!called) {
|
|
23
|
+
called = true;
|
|
24
|
+
result = function_.apply(this, arguments_);
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=once.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"once.js","sourceRoot":"","sources":["../../src/Function/once.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,SAAkC,EACP,EAAE;IAC7B,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,MAAS,CAAC;IAEd,OAAO,UAAyB,GAAG,UAAa;QAC9C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,IAAI,CAAC;YACd,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A throttled function with a cancel method.
|
|
3
|
+
*/
|
|
4
|
+
export interface ThrottledFunction<T extends (...arguments_: unknown[]) => unknown> {
|
|
5
|
+
(...arguments_: Parameters<T>): void;
|
|
6
|
+
/** Cancels any pending throttled invocation. */
|
|
7
|
+
cancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a throttled version of the provided function that only
|
|
11
|
+
* invokes it at most once per the specified wait period.
|
|
12
|
+
*
|
|
13
|
+
* @param function_ - The function to throttle.
|
|
14
|
+
* @param wait - The minimum time between invocations in milliseconds.
|
|
15
|
+
* @returns The throttled function with a cancel method.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const throttled = throttle(() => console.log("called"), 300);
|
|
20
|
+
* throttled();
|
|
21
|
+
* throttled();
|
|
22
|
+
* throttled.cancel();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const throttle: <T extends (...arguments_: unknown[]) => unknown>(function_: T, wait: number) => ThrottledFunction<T>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a throttled version of the provided function that only
|
|
3
|
+
* invokes it at most once per the specified wait period.
|
|
4
|
+
*
|
|
5
|
+
* @param function_ - The function to throttle.
|
|
6
|
+
* @param wait - The minimum time between invocations in milliseconds.
|
|
7
|
+
* @returns The throttled function with a cancel method.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const throttled = throttle(() => console.log("called"), 300);
|
|
12
|
+
* throttled();
|
|
13
|
+
* throttled();
|
|
14
|
+
* throttled.cancel();
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export const throttle = (function_, wait) => {
|
|
18
|
+
let lastCallTime = 0;
|
|
19
|
+
let timerId;
|
|
20
|
+
let lastContext;
|
|
21
|
+
const invoke = () => {
|
|
22
|
+
lastCallTime = Date.now();
|
|
23
|
+
const context = lastContext;
|
|
24
|
+
function_.apply(context.thisArg, context.arguments_);
|
|
25
|
+
lastContext = undefined;
|
|
26
|
+
};
|
|
27
|
+
const throttled = function (...arguments_) {
|
|
28
|
+
lastContext = { arguments_, thisArg: this };
|
|
29
|
+
const elapsed = Date.now() - lastCallTime;
|
|
30
|
+
const remaining = wait - elapsed;
|
|
31
|
+
if (remaining <= 0) {
|
|
32
|
+
if (timerId !== undefined) {
|
|
33
|
+
clearTimeout(timerId);
|
|
34
|
+
timerId = undefined;
|
|
35
|
+
}
|
|
36
|
+
invoke();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
timerId ??= setTimeout(() => {
|
|
40
|
+
timerId = undefined;
|
|
41
|
+
invoke();
|
|
42
|
+
}, remaining);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
throttled.cancel = () => {
|
|
46
|
+
if (timerId !== undefined) {
|
|
47
|
+
clearTimeout(timerId);
|
|
48
|
+
}
|
|
49
|
+
timerId = undefined;
|
|
50
|
+
lastContext = undefined;
|
|
51
|
+
lastCallTime = 0;
|
|
52
|
+
};
|
|
53
|
+
return throttled;
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=throttle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../src/Function/throttle.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,SAAY,EACZ,IAAY,EACU,EAAE;IACxB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,OAAkD,CAAC;IACvD,IAAI,WAAwE,CAAC;IAE7E,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAG,WAGf,CAAC;QACF,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QACrD,WAAW,GAAG,SAAS,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,UAEhB,GAAG,UAAyB;QAE5B,WAAW,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC;QAC1C,MAAM,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC;QAEjC,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;YACnB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtB,OAAO,GAAG,SAAS,CAAC;YACtB,CAAC;YACD,MAAM,EAAE,CAAC;QACX,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,UAAU,CAAC,GAAG,EAAE;gBAC1B,OAAO,GAAG,SAAS,CAAC;gBACpB,MAAM,EAAE,CAAC;YACX,CAAC,EAAE,SAAS,CAAC,CAAC;QAChB,CAAC;IACH,CAAyB,CAAC;IAE1B,SAAS,CAAC,MAAM,GAAG,GAAG,EAAE;QACtB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,GAAG,SAAS,CAAC;QACpB,WAAW,GAAG,SAAS,CAAC;QACxB,YAAY,GAAG,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
package/module/IP/cidrToLong.js
CHANGED
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
* Converts CIDR notation to a subnet mask number
|
|
3
3
|
* @param {number} cidr - CIDR notation (0-32)
|
|
4
4
|
* @returns {number} Subnet mask as a 32-bit number
|
|
5
|
-
* @throws {Error} If CIDR is not between 0 and 32
|
|
6
5
|
*/
|
|
7
6
|
export const cidrToLong = (cidr) => {
|
|
8
|
-
if (!Number.isInteger(cidr) || cidr < 0 || cidr > 32) {
|
|
9
|
-
throw new Error("CIDR must be an integer between 0 and 32");
|
|
10
|
-
}
|
|
11
7
|
return Number.parseInt("1".repeat(cidr).padEnd(32, "0"), 2) >>> 0;
|
|
12
8
|
};
|
|
13
9
|
//# sourceMappingURL=cidrToLong.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cidrToLong.js","sourceRoot":"","sources":["../../src/IP/cidrToLong.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cidrToLong.js","sourceRoot":"","sources":["../../src/IP/cidrToLong.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE;IACjD,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC,CAAC"}
|
|
@@ -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;
|
|
@@ -4,7 +4,6 @@ import { longToIp } from "./longToIp";
|
|
|
4
4
|
* Converts CIDR notation to a subnet mask
|
|
5
5
|
* @param {number} cidr - CIDR notation (0-32)
|
|
6
6
|
* @returns {string} Subnet mask in IPv4 format (e.g., "255.255.255.0")
|
|
7
|
-
* @throws {Error} If CIDR is not between 0 and 32
|
|
8
7
|
*/
|
|
9
8
|
export const cidrToSubnetMask = (cidr) => longToIp(cidrToLong(cidr));
|
|
10
9
|
//# sourceMappingURL=cidrToSubnetMask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cidrToSubnetMask.js","sourceRoot":"","sources":["../../src/IP/cidrToSubnetMask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"cidrToSubnetMask.js","sourceRoot":"","sources":["../../src/IP/cidrToSubnetMask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAU,EAAE,CACvD,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -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;
|
|
@@ -6,39 +6,9 @@ import { subnetMaskToCidr } from "./subnetMaskToCidr";
|
|
|
6
6
|
* @param {string} ip - IPv4 address (e.g., "192.168.1.1")
|
|
7
7
|
* @param {string} subnetMask - Subnet mask (e.g., "255.255.255.0")
|
|
8
8
|
* @returns {number} Network address as a 32-bit unsigned integer
|
|
9
|
-
* @throws {Error} If IP address or subnet mask is invalid
|
|
10
9
|
*/
|
|
11
10
|
export const getNetworkAddress = (ip, subnetMask) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
if (!subnetMask) {
|
|
16
|
-
throw new Error("Subnet mask is required");
|
|
17
|
-
}
|
|
18
|
-
// Validate IP format
|
|
19
|
-
const ipParts = ip.split(".");
|
|
20
|
-
if (ipParts.length !== 4 ||
|
|
21
|
-
!ipParts.every((part) => {
|
|
22
|
-
const number_ = Number.parseInt(part, 10);
|
|
23
|
-
return !Number.isNaN(number_) && number_ >= 0 && number_ <= 255;
|
|
24
|
-
})) {
|
|
25
|
-
throw new TypeError("Invalid IP address or subnet mask");
|
|
26
|
-
}
|
|
27
|
-
// Validate subnet mask format
|
|
28
|
-
const maskParts = subnetMask.split(".");
|
|
29
|
-
if (maskParts.length !== 4 ||
|
|
30
|
-
!maskParts.every((part) => {
|
|
31
|
-
const number_ = Number.parseInt(part, 10);
|
|
32
|
-
return !Number.isNaN(number_) && number_ >= 0 && number_ <= 255;
|
|
33
|
-
})) {
|
|
34
|
-
throw new TypeError("Invalid IP address or subnet mask");
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
const networkAddress = ipToLong(ip) & cidrToLong(subnetMaskToCidr(subnetMask));
|
|
38
|
-
return networkAddress >>> 0; // Convert to unsigned 32-bit integer
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
throw new TypeError("Invalid IP address or subnet mask");
|
|
42
|
-
}
|
|
11
|
+
const networkAddress = ipToLong(ip) & cidrToLong(subnetMaskToCidr(subnetMask));
|
|
12
|
+
return networkAddress >>> 0; // Convert to unsigned 32-bit integer
|
|
43
13
|
};
|
|
44
14
|
//# sourceMappingURL=getNetworkAddress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNetworkAddress.js","sourceRoot":"","sources":["../../src/IP/getNetworkAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"getNetworkAddress.js","sourceRoot":"","sources":["../../src/IP/getNetworkAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAU,EAAE,UAAkB,EAAU,EAAE;IAC1E,MAAM,cAAc,GAClB,QAAQ,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1D,OAAO,cAAc,KAAK,CAAC,CAAC,CAAC,qCAAqC;AACpE,CAAC,CAAC"}
|
|
@@ -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;
|
|
@@ -2,33 +2,10 @@
|
|
|
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 const ipToBinaryString = (ip) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
// Check for invalid characters
|
|
12
|
-
if (/[^0-9.]/.test(ip)) {
|
|
13
|
-
throw new Error("Invalid IP address format");
|
|
14
|
-
}
|
|
15
|
-
const parts = ip.split(".");
|
|
16
|
-
if (parts.length !== 4) {
|
|
17
|
-
throw new Error("Invalid IP address format");
|
|
18
|
-
}
|
|
19
|
-
// Validate each octet
|
|
20
|
-
for (const octet of parts) {
|
|
21
|
-
// Check for empty octet or leading zeros
|
|
22
|
-
if (!octet || (octet.length > 1 && octet.startsWith("0"))) {
|
|
23
|
-
throw new Error("Invalid IP address format");
|
|
24
|
-
}
|
|
25
|
-
const number = Number.parseInt(octet, 10);
|
|
26
|
-
if (Number.isNaN(number) || number < 0 || number > 255) {
|
|
27
|
-
throw new Error("Invalid IP address format");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
// Convert to binary
|
|
31
|
-
return parts
|
|
7
|
+
return ip
|
|
8
|
+
.split(".")
|
|
32
9
|
.map((octet) => Number.parseInt(octet, 10).toString(2).padStart(8, "0"))
|
|
33
10
|
.join("");
|
|
34
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ipToBinaryString.js","sourceRoot":"","sources":["../../src/IP/ipToBinaryString.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ipToBinaryString.js","sourceRoot":"","sources":["../../src/IP/ipToBinaryString.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAU,EAAU,EAAE;IACrD,OAAO,EAAE;SACN,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SACvE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC,CAAC"}
|
package/module/IP/ipToLong.d.ts
CHANGED
package/module/IP/ipToLong.js
CHANGED
|
@@ -3,7 +3,6 @@ import { ipToBinaryString } from "./ipToBinaryString";
|
|
|
3
3
|
* Converts an IPv4 address to a 32-bit number
|
|
4
4
|
* @param {string} ip - IPv4 address to convert (e.g., "192.168.1.1")
|
|
5
5
|
* @returns {number} 32-bit unsigned integer
|
|
6
|
-
* @throws {Error} If IP address is invalid
|
|
7
6
|
*/
|
|
8
7
|
export const ipToLong = (ip) => Number.parseInt(ipToBinaryString(ip), 2) >>> 0;
|
|
9
8
|
//# sourceMappingURL=ipToLong.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ipToLong.js","sourceRoot":"","sources":["../../src/IP/ipToLong.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"ipToLong.js","sourceRoot":"","sources":["../../src/IP/ipToLong.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAU,EAAU,EAAE,CAC7C,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC"}
|
package/module/IP/isInRange.d.ts
CHANGED
|
@@ -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;
|