umt 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/module/Advance/rangeAdvance.d.ts +10 -6
- package/module/Advance/rangeAdvance.js +10 -6
- package/module/Advance/rangeAdvance.js.map +1 -1
- package/module/Array/arraysJoin.d.ts +4 -4
- package/module/Array/arraysJoin.js +4 -4
- package/module/Array/binarySearch.d.ts +4 -3
- package/module/Array/binarySearch.js +4 -3
- package/module/Array/binarySearch.js.map +1 -1
- package/module/Array/checkFlagAlignment.d.ts +3 -3
- package/module/Array/checkFlagAlignment.js +7 -7
- package/module/Array/checkFlagAlignment.js.map +1 -1
- package/module/Array/chunk.d.ts +4 -4
- package/module/Array/compact.d.ts +8 -0
- package/module/Array/compact.js +8 -0
- package/module/Array/compact.js.map +1 -1
- package/module/Array/compareFunctionDefault.d.ts +13 -0
- package/module/Array/compareFunctionDefault.js +13 -0
- package/module/Array/compareFunctionDefault.js.map +1 -1
- package/module/Array/drop.d.ts +5 -5
- package/module/Array/drop.js +5 -5
- package/module/Array/dualPivotQuickSort.d.ts +16 -0
- package/module/Array/dualPivotQuickSort.js +152 -0
- package/module/Array/dualPivotQuickSort.js.map +1 -0
- package/module/Array/first.d.ts +3 -3
- package/module/Array/first.js +3 -3
- package/module/Array/generateNumberArray.d.ts +6 -6
- package/module/Array/generateNumberArray.js +6 -6
- package/module/Array/getArraysCommon.d.ts +4 -4
- package/module/Array/getArraysCommon.js +4 -4
- package/module/Array/getArraysDiff.d.ts +4 -4
- package/module/Array/getArraysDiff.js +4 -4
- package/module/Array/groupBy.d.ts +8 -4
- package/module/Array/groupBy.js +8 -4
- package/module/Array/groupBy.js.map +1 -1
- package/module/Array/index.d.ts +1 -0
- package/module/Array/index.js +1 -0
- package/module/Array/index.js.map +1 -1
- package/module/Array/insertionSort.d.ts +8 -7
- package/module/Array/insertionSort.js +6 -6
- package/module/Array/insertionSort.js.map +1 -1
- package/module/Array/mergeSort.d.ts +6 -5
- package/module/Array/mergeSort.js +9 -9
- package/module/Array/mergeSort.js.map +1 -1
- package/module/Array/quickSort.d.ts +12 -11
- package/module/Array/quickSort.js +44 -10
- package/module/Array/quickSort.js.map +1 -1
- package/module/Array/randomSelect.d.ts +5 -5
- package/module/Array/randomSelect.js +5 -5
- package/module/Array/range.d.ts +5 -5
- package/module/Array/range.js +26 -10
- package/module/Array/range.js.map +1 -1
- package/module/Array/shuffle.d.ts +3 -3
- package/module/Array/shuffle.js +3 -3
- package/module/Array/shuffle2DArray.d.ts +4 -4
- package/module/Array/shuffle2DArray.js +6 -6
- package/module/Array/shuffle2DArray.js.map +1 -1
- package/module/Array/sum.d.ts +3 -3
- package/module/Array/sum.js +4 -4
- package/module/Array/sum.js.map +1 -1
- package/module/Array/timSort.d.ts +13 -11
- package/module/Array/timSort.js +33 -9
- package/module/Array/timSort.js.map +1 -1
- package/module/Array/zip.d.ts +6 -3
- package/module/Array/zip.js +6 -3
- package/module/Array/zip.js.map +1 -1
- package/module/Array/zipLongest.d.ts +8 -5
- package/module/Array/zipLongest.js +8 -5
- package/module/Array/zipLongest.js.map +1 -1
- package/module/Color/cmykToRgba.d.ts +7 -7
- package/module/Color/cmykToRgba.js +12 -12
- package/module/Color/cmykToRgba.js.map +1 -1
- package/module/Color/hexaToRgba.d.ts +4 -3
- package/module/Color/hexaToRgba.js +18 -7
- package/module/Color/hexaToRgba.js.map +1 -1
- package/module/Color/hslaToRgba.d.ts +7 -6
- package/module/Color/hslaToRgba.js +19 -15
- package/module/Color/hslaToRgba.js.map +1 -1
- package/module/Color/rgbaToCmyk.d.ts +3 -3
- package/module/Color/rgbaToCmyk.js +14 -3
- package/module/Color/rgbaToCmyk.js.map +1 -1
- package/module/Color/rgbaToHexA.d.ts +4 -4
- package/module/Color/rgbaToHexA.js +5 -5
- package/module/Color/rgbaToHexA.js.map +1 -1
- package/module/Color/rgbaToHsla.d.ts +4 -3
- package/module/Color/rgbaToHsla.js +15 -3
- package/module/Color/rgbaToHsla.js.map +1 -1
- package/module/Consts/clock.d.ts +11 -11
- package/module/Consts/clock.js +11 -11
- package/module/Consts/httpStatus/httpClientErrorStatus.d.ts +28 -0
- package/module/Consts/httpStatus/httpClientErrorStatus.js +28 -0
- package/module/Consts/httpStatus/httpClientErrorStatus.js.map +1 -1
- package/module/Consts/httpStatus/httpInformationalStatus.d.ts +9 -0
- package/module/Consts/httpStatus/httpInformationalStatus.js +9 -0
- package/module/Consts/httpStatus/httpInformationalStatus.js.map +1 -1
- package/module/Consts/httpStatus/httpRedirectionStatus.d.ts +11 -0
- package/module/Consts/httpStatus/httpRedirectionStatus.js +11 -0
- package/module/Consts/httpStatus/httpRedirectionStatus.js.map +1 -1
- package/module/Consts/httpStatus/httpServerErrorStatus.d.ts +10 -0
- package/module/Consts/httpStatus/httpServerErrorStatus.js +10 -0
- package/module/Consts/httpStatus/httpServerErrorStatus.js.map +1 -1
- package/module/Consts/httpStatus/httpSuccessStatus.d.ts +11 -0
- package/module/Consts/httpStatus/httpSuccessStatus.js +11 -0
- package/module/Consts/httpStatus/httpSuccessStatus.js.map +1 -1
- package/module/Date/birthday.d.ts +7 -6
- package/module/Date/birthday.js +7 -6
- package/module/Date/birthday.js.map +1 -1
- package/module/Date/dateRange.d.ts +7 -4
- package/module/Date/dateRange.js +7 -4
- package/module/Date/dateRange.js.map +1 -1
- package/module/Date/dayOfWeek.d.ts +4 -4
- package/module/Date/dayOfWeek.js +4 -4
- package/module/Date/format.d.ts +30 -4
- package/module/Date/format.js +30 -4
- package/module/Date/format.js.map +1 -1
- package/module/Date/getDay.d.ts +8 -5
- package/module/Date/getDay.js +8 -5
- package/module/Date/getDay.js.map +1 -1
- package/module/Date/getTimezoneOffsetString.d.ts +3 -3
- package/module/Date/getTimezoneOffsetString.js +3 -3
- package/module/Date/isLeapYear.d.ts +8 -3
- package/module/Date/isLeapYear.js +8 -3
- package/module/Date/isLeapYear.js.map +1 -1
- package/module/Date/new.d.ts +20 -20
- package/module/Date/new.js +21 -21
- package/module/Date/new.js.map +1 -1
- package/module/Date/now.d.ts +7 -4
- package/module/Date/now.js +7 -4
- package/module/Date/now.js.map +1 -1
- package/module/Error/safeExecute.d.ts +21 -0
- package/module/Error/safeExecute.js +20 -0
- package/module/Error/safeExecute.js.map +1 -1
- package/module/IP/cidrToLong.d.ts +4 -3
- package/module/IP/cidrToLong.js +10 -4
- package/module/IP/cidrToLong.js.map +1 -1
- package/module/IP/cidrToSubnetMask.d.ts +4 -3
- package/module/IP/cidrToSubnetMask.js +4 -3
- package/module/IP/cidrToSubnetMask.js.map +1 -1
- package/module/IP/getIpClass.d.ts +3 -3
- package/module/IP/getIpClass.js +30 -18
- package/module/IP/getIpClass.js.map +1 -1
- package/module/IP/getNetworkAddress.d.ts +5 -4
- package/module/IP/getNetworkAddress.js +36 -6
- package/module/IP/getNetworkAddress.js.map +1 -1
- package/module/IP/ipToBinaryString.d.ts +4 -3
- package/module/IP/ipToBinaryString.js +32 -7
- package/module/IP/ipToBinaryString.js.map +1 -1
- package/module/IP/ipToLong.d.ts +4 -3
- package/module/IP/ipToLong.js +4 -3
- package/module/IP/ipToLong.js.map +1 -1
- package/module/IP/isInRange.d.ts +6 -5
- package/module/IP/isInRange.js +33 -7
- package/module/IP/isInRange.js.map +1 -1
- package/module/IP/isPrivateIp.d.ts +4 -3
- package/module/IP/isPrivateIp.js +17 -9
- package/module/IP/isPrivateIp.js.map +1 -1
- package/module/IP/longToIp.d.ts +4 -3
- package/module/IP/longToIp.js +16 -4
- package/module/IP/longToIp.js.map +1 -1
- package/module/IP/subnetMaskToCidr.d.ts +4 -3
- package/module/IP/subnetMaskToCidr.js +28 -12
- package/module/IP/subnetMaskToCidr.js.map +1 -1
- package/module/Math/addition.d.ts +3 -3
- package/module/Math/addition.js +3 -3
- package/module/Math/average.d.ts +7 -4
- package/module/Math/average.js +7 -4
- package/module/Math/average.js.map +1 -1
- package/module/Math/bitwise.d.ts +5 -5
- package/module/Math/bitwise.js +5 -5
- package/module/Math/calculator/calculator.d.ts +9 -7
- package/module/Math/calculator/calculator.js +9 -7
- package/module/Math/calculator/calculator.js.map +1 -1
- package/module/Math/calculator/calculatorInitialization.d.ts +4 -3
- package/module/Math/calculator/calculatorInitialization.js +6 -5
- package/module/Math/calculator/calculatorInitialization.js.map +1 -1
- package/module/Math/calculator/convertCurrency.d.ts +6 -4
- package/module/Math/calculator/convertCurrency.js +6 -4
- package/module/Math/calculator/convertCurrency.js.map +1 -1
- package/module/Math/calculator/core.js +13 -13
- package/module/Math/calculator/core.js.map +1 -1
- package/module/Math/calculator/literalExpression.d.ts +5 -3
- package/module/Math/calculator/literalExpression.js +12 -10
- package/module/Math/calculator/literalExpression.js.map +1 -1
- package/module/Math/degToRad.d.ts +3 -3
- package/module/Math/degToRad.js +3 -3
- package/module/Math/deviationValue.d.ts +5 -5
- package/module/Math/deviationValue.js +5 -5
- package/module/Math/division.d.ts +5 -5
- package/module/Math/division.js +31 -21
- package/module/Math/division.js.map +1 -1
- package/module/Math/factorial.d.ts +3 -3
- package/module/Math/factorial.js +3 -3
- package/module/Math/factorize.d.ts +3 -3
- package/module/Math/factorize.js +3 -3
- package/module/Math/flexibleNumberConversion.d.ts +11 -11
- package/module/Math/flexibleNumberConversion.js +19 -19
- package/module/Math/flexibleNumberConversion.js.map +1 -1
- package/module/Math/gcd.d.ts +5 -5
- package/module/Math/gcd.js +6 -6
- package/module/Math/gcd.js.map +1 -1
- package/module/Math/getDecimalLength.d.ts +7 -4
- package/module/Math/getDecimalLength.js +9 -5
- package/module/Math/getDecimalLength.js.map +1 -1
- package/module/Math/lcm.d.ts +4 -4
- package/module/Math/lcm.js +5 -5
- package/module/Math/lcm.js.map +1 -1
- package/module/Math/linearCongruentialGenerator.d.ts +6 -6
- package/module/Math/linearCongruentialGenerator.js +6 -6
- package/module/Math/mathConverter.d.ts +7 -3
- package/module/Math/mathConverter.js +7 -3
- package/module/Math/mathConverter.js.map +1 -1
- package/module/Math/mathSeparator.d.ts +8 -3
- package/module/Math/mathSeparator.js +8 -3
- package/module/Math/mathSeparator.js.map +1 -1
- package/module/Math/max.d.ts +4 -3
- package/module/Math/max.js +4 -3
- package/module/Math/max.js.map +1 -1
- package/module/Math/median.d.ts +3 -3
- package/module/Math/median.js +3 -3
- package/module/Math/min.d.ts +4 -3
- package/module/Math/min.js +4 -3
- package/module/Math/min.js.map +1 -1
- package/module/Math/multiples.d.ts +4 -4
- package/module/Math/multiples.js +4 -4
- package/module/Math/multiplication.d.ts +3 -3
- package/module/Math/multiplication.js +3 -3
- package/module/Math/nCr.d.ts +7 -4
- package/module/Math/nCr.js +7 -4
- package/module/Math/nCr.js.map +1 -1
- package/module/Math/nHr.d.ts +7 -4
- package/module/Math/nHr.js +7 -4
- package/module/Math/nHr.js.map +1 -1
- package/module/Math/nPr.d.ts +7 -4
- package/module/Math/nPr.js +7 -4
- package/module/Math/nPr.js.map +1 -1
- package/module/Math/primeFactorization.d.ts +6 -3
- package/module/Math/primeFactorization.js +11 -8
- package/module/Math/primeFactorization.js.map +1 -1
- package/module/Math/quotient.d.ts +7 -4
- package/module/Math/quotient.js +7 -4
- package/module/Math/quotient.js.map +1 -1
- package/module/Math/radToDeg.d.ts +5 -3
- package/module/Math/radToDeg.js +5 -3
- package/module/Math/radToDeg.js.map +1 -1
- package/module/Math/random.d.ts +6 -5
- package/module/Math/random.js +6 -5
- package/module/Math/random.js.map +1 -1
- package/module/Math/reduce.d.ts +9 -4
- package/module/Math/reduce.js +16 -6
- package/module/Math/reduce.js.map +1 -1
- package/module/Math/repeatedTrial.d.ts +5 -5
- package/module/Math/repeatedTrial.js +5 -5
- package/module/Math/roundOf.d.ts +7 -5
- package/module/Math/roundOf.js +8 -6
- package/module/Math/roundOf.js.map +1 -1
- package/module/Math/solveEquation.d.ts +12 -13
- package/module/Math/solveEquation.js +32 -37
- package/module/Math/solveEquation.js.map +1 -1
- package/module/Math/standardDeviation.d.ts +8 -3
- package/module/Math/standardDeviation.js +13 -7
- package/module/Math/standardDeviation.js.map +1 -1
- package/module/Math/subtract.d.ts +10 -4
- package/module/Math/subtract.js +12 -6
- package/module/Math/subtract.js.map +1 -1
- package/module/Math/toBaseN.d.ts +8 -6
- package/module/Math/toBaseN.js +9 -7
- package/module/Math/toBaseN.js.map +1 -1
- package/module/Math/toCelsius.d.ts +5 -3
- package/module/Math/toCelsius.js +5 -3
- package/module/Math/toCelsius.js.map +1 -1
- package/module/Math/toKelvin.d.ts +5 -3
- package/module/Math/toKelvin.js +5 -3
- package/module/Math/toKelvin.js.map +1 -1
- package/module/Math/uuidv7.d.ts +10 -2
- package/module/Math/uuidv7.js +10 -2
- package/module/Math/uuidv7.js.map +1 -1
- package/module/Math/valueSwap.d.ts +5 -4
- package/module/Math/valueSwap.js +5 -4
- package/module/Math/valueSwap.js.map +1 -1
- package/module/Math/xoshiro256.d.ts +8 -3
- package/module/Math/xoshiro256.js +8 -3
- package/module/Math/xoshiro256.js.map +1 -1
- package/module/Object/has.d.ts +4 -4
- package/module/Object/has.js +4 -4
- package/module/Object/keyBy.d.ts +3 -3
- package/module/Object/keyBy.js +4 -4
- package/module/Object/pick.d.ts +6 -6
- package/module/Object/pick.js +6 -6
- package/module/Object/pickDeep.d.ts +7 -7
- package/module/Object/pickDeep.js +7 -7
- package/module/Simple/Array/quickSortSimple.d.ts +9 -7
- package/module/Simple/Array/quickSortSimple.js +7 -6
- package/module/Simple/Array/quickSortSimple.js.map +1 -1
- package/module/Simple/Date/birthdaySimple.d.ts +4 -4
- package/module/Simple/Date/birthdaySimple.js +4 -4
- package/module/Simple/Date/dayOfWeekSimple.d.ts +4 -4
- package/module/Simple/Date/nowSimple.d.ts +3 -3
- package/module/Simple/Date/nowSimple.js +3 -3
- package/module/Simple/Math/deviationValueSimple.d.ts +10 -11
- package/module/Simple/Math/deviationValueSimple.js +14 -13
- package/module/Simple/Math/deviationValueSimple.js.map +1 -1
- package/module/String/deleteSpaces.d.ts +8 -4
- package/module/String/deleteSpaces.js +8 -4
- package/module/String/deleteSpaces.js.map +1 -1
- package/module/String/formatString.d.ts +8 -8
- package/module/String/formatString.js +7 -7
- package/module/String/formatString.js.map +1 -1
- package/module/String/fromBase64.d.ts +4 -3
- package/module/String/fromBase64.js +15 -9
- package/module/String/fromBase64.js.map +1 -1
- package/module/String/hasNoLetters.d.ts +9 -3
- package/module/String/hasNoLetters.js +12 -6
- package/module/String/hasNoLetters.js.map +1 -1
- package/module/String/padEnd.d.ts +5 -5
- package/module/String/padEnd.js +5 -5
- package/module/String/padStart.d.ts +11 -5
- package/module/String/padStart.js +17 -5
- package/module/String/padStart.js.map +1 -1
- package/module/String/randomString.d.ts +4 -4
- package/module/String/randomString.js +4 -4
- package/module/String/randomStringInitialization.d.ts +3 -3
- package/module/String/randomStringInitialization.js +3 -3
- package/module/String/reverseString.d.ts +3 -3
- package/module/String/reverseString.js +3 -3
- package/module/String/toBase64.d.ts +3 -3
- package/module/String/toBase64.js +3 -3
- package/module/String/toHalfWidth.d.ts +3 -3
- package/module/String/toHalfWidth.js +3 -3
- package/module/String/trimCharacters.d.ts +4 -4
- package/module/String/trimCharacters.js +4 -4
- package/module/String/trimEndCharacters.d.ts +10 -4
- package/module/String/trimEndCharacters.js +10 -4
- package/module/String/trimEndCharacters.js.map +1 -1
- package/module/String/trimStartCharacters.d.ts +10 -4
- package/module/String/trimStartCharacters.js +10 -4
- package/module/String/trimStartCharacters.js.map +1 -1
- package/module/Time/convertTime.d.ts +6 -6
- package/module/Time/convertTime.js +12 -11
- package/module/Time/convertTime.js.map +1 -1
- package/module/Tool/createPipeline.d.ts +8 -6
- package/module/Tool/createPipeline.js +6 -5
- package/module/Tool/createPipeline.js.map +1 -1
- package/module/Tool/parseJson.d.ts +7 -0
- package/module/Tool/parseJson.js +7 -0
- package/module/Tool/parseJson.js.map +1 -1
- package/module/UA/extractBrowserFromUserAgent.d.ts +12 -0
- package/module/UA/extractBrowserFromUserAgent.js +22 -5
- package/module/UA/extractBrowserFromUserAgent.js.map +1 -1
- package/module/UA/extractDeviceFromUserAgent.d.ts +12 -0
- package/module/UA/extractDeviceFromUserAgent.js +12 -0
- package/module/UA/extractDeviceFromUserAgent.js.map +1 -1
- package/module/UA/extractOsFromUserAgent.d.ts +12 -0
- package/module/UA/extractOsFromUserAgent.js +12 -0
- package/module/UA/extractOsFromUserAgent.js.map +1 -1
- package/module/UA/parseUserAgent.d.ts +16 -0
- package/module/UA/parseUserAgent.js +16 -0
- package/module/UA/parseUserAgent.js.map +1 -1
- package/module/Unit/unitConverterInitialization.d.ts +15 -0
- package/module/Unit/unitConverterInitialization.js +15 -0
- package/module/Unit/unitConverterInitialization.js.map +1 -1
- package/module/Validate/array/core.d.ts +12 -0
- package/module/Validate/array/core.js +15 -3
- package/module/Validate/array/core.js.map +1 -1
- package/module/Validate/boolean/core.d.ts +9 -0
- package/module/Validate/boolean/core.js +9 -0
- package/module/Validate/boolean/core.js.map +1 -1
- package/module/Validate/core/index.d.ts +10 -0
- package/module/Validate/core/index.js +11 -1
- package/module/Validate/core/index.js.map +1 -1
- package/module/Validate/isArray.d.ts +3 -3
- package/module/Validate/isArray.js +3 -3
- package/module/Validate/isBrowser.d.ts +1 -1
- package/module/Validate/isBrowser.js +1 -1
- package/module/Validate/isBun.d.ts +1 -1
- package/module/Validate/isBun.js +1 -1
- package/module/Validate/isDictionaryObject.d.ts +3 -3
- package/module/Validate/isDictionaryObject.js +3 -3
- package/module/Validate/isDouble.d.ts +4 -4
- package/module/Validate/isDouble.js +4 -4
- package/module/Validate/isNode.d.ts +1 -1
- package/module/Validate/isNode.js +1 -1
- package/module/Validate/isNodeWebkit.d.ts +1 -1
- package/module/Validate/isNodeWebkit.js +1 -1
- package/module/Validate/isNotEmpty.d.ts +3 -3
- package/module/Validate/isNotEmpty.js +4 -4
- package/module/Validate/isNotEmpty.js.map +1 -1
- package/module/Validate/isNumber.d.ts +4 -4
- package/module/Validate/isNumber.js +10 -4
- package/module/Validate/isNumber.js.map +1 -1
- package/module/Validate/isPerfectSquare.d.ts +8 -3
- package/module/Validate/isPerfectSquare.js +8 -3
- package/module/Validate/isPerfectSquare.js.map +1 -1
- package/module/Validate/isPrimeNumber.d.ts +7 -3
- package/module/Validate/isPrimeNumber.js +8 -4
- package/module/Validate/isPrimeNumber.js.map +1 -1
- package/module/Validate/isValueNaN.d.ts +7 -5
- package/module/Validate/isValueNaN.js +7 -5
- package/module/Validate/isValueNaN.js.map +1 -1
- package/module/Validate/number/core.d.ts +11 -0
- package/module/Validate/number/core.js +11 -0
- package/module/Validate/number/core.js.map +1 -1
- package/module/Validate/number/double.d.ts +9 -0
- package/module/Validate/number/double.js +9 -0
- package/module/Validate/number/double.js.map +1 -1
- package/module/Validate/number/even.d.ts +9 -0
- package/module/Validate/number/even.js +9 -0
- package/module/Validate/number/even.js.map +1 -1
- package/module/Validate/number/maxValue.d.ts +10 -0
- package/module/Validate/number/maxValue.js +10 -0
- package/module/Validate/number/maxValue.js.map +1 -1
- package/module/Validate/number/minValue.d.ts +10 -0
- package/module/Validate/number/minValue.js +10 -0
- package/module/Validate/number/minValue.js.map +1 -1
- package/module/Validate/number/prime.d.ts +9 -0
- package/module/Validate/number/prime.js +9 -0
- package/module/Validate/number/prime.js.map +1 -1
- package/module/Validate/object/core.d.ts +11 -0
- package/module/Validate/object/core.js +11 -0
- package/module/Validate/object/core.js.map +1 -1
- package/module/Validate/string/core.d.ts +11 -0
- package/module/Validate/string/core.js +11 -0
- package/module/Validate/string/core.js.map +1 -1
- package/module/Validate/string/email.d.ts +9 -0
- package/module/Validate/string/email.js +10 -1
- package/module/Validate/string/email.js.map +1 -1
- package/module/Validate/string/length.d.ts +11 -0
- package/module/Validate/string/length.js +11 -0
- package/module/Validate/string/length.js.map +1 -1
- package/module/Validate/string/maxLength.d.ts +10 -0
- package/module/Validate/string/maxLength.js +10 -0
- package/module/Validate/string/maxLength.js.map +1 -1
- package/module/Validate/string/minLength.d.ts +10 -0
- package/module/Validate/string/minLength.js +10 -0
- package/module/Validate/string/minLength.js.map +1 -1
- package/module/Validate/string/numberString.d.ts +9 -0
- package/module/Validate/string/numberString.js +9 -0
- package/module/Validate/string/numberString.js.map +1 -1
- package/module/Validate/string/regexMatch.d.ts +10 -0
- package/module/Validate/string/regexMatch.js +10 -0
- package/module/Validate/string/regexMatch.js.map +1 -1
- package/module/Validate/string/uuid.d.ts +8 -3
- package/module/Validate/string/uuid.js +9 -4
- package/module/Validate/string/uuid.js.map +1 -1
- package/module/Validate/type.d.ts +22 -0
- package/module/es5/Advance/rangeAdvance.d.ts +10 -6
- package/module/es5/Advance/rangeAdvance.js +10 -6
- package/module/es5/Array/arraysJoin.d.ts +4 -4
- package/module/es5/Array/arraysJoin.js +4 -4
- package/module/es5/Array/binarySearch.d.ts +4 -3
- package/module/es5/Array/binarySearch.js +4 -3
- package/module/es5/Array/checkFlagAlignment.d.ts +3 -3
- package/module/es5/Array/checkFlagAlignment.js +7 -7
- package/module/es5/Array/chunk.d.ts +4 -4
- package/module/es5/Array/chunk.js +4 -4
- package/module/es5/Array/compact.d.ts +8 -0
- package/module/es5/Array/compact.js +8 -0
- package/module/es5/Array/compareFunctionDefault.d.ts +13 -0
- package/module/es5/Array/compareFunctionDefault.js +13 -0
- package/module/es5/Array/drop.d.ts +5 -5
- package/module/es5/Array/drop.js +5 -5
- package/module/es5/Array/dualPivotQuickSort.d.ts +16 -0
- package/module/es5/Array/dualPivotQuickSort.js +201 -0
- package/module/es5/Array/first.d.ts +3 -3
- package/module/es5/Array/first.js +3 -3
- package/module/es5/Array/generateNumberArray.d.ts +6 -6
- package/module/es5/Array/generateNumberArray.js +6 -6
- package/module/es5/Array/getArraysCommon.d.ts +4 -4
- package/module/es5/Array/getArraysCommon.js +4 -4
- package/module/es5/Array/getArraysDiff.d.ts +4 -4
- package/module/es5/Array/getArraysDiff.js +4 -4
- package/module/es5/Array/groupBy.d.ts +8 -4
- package/module/es5/Array/groupBy.js +8 -4
- package/module/es5/Array/index.d.ts +1 -0
- package/module/es5/Array/index.js +11 -0
- package/module/es5/Array/insertionSort.d.ts +8 -7
- package/module/es5/Array/insertionSort.js +6 -6
- package/module/es5/Array/mergeSort.d.ts +6 -5
- package/module/es5/Array/mergeSort.js +9 -9
- package/module/es5/Array/quickSort.d.ts +12 -11
- package/module/es5/Array/quickSort.js +47 -10
- package/module/es5/Array/randomSelect.d.ts +5 -5
- package/module/es5/Array/randomSelect.js +5 -5
- package/module/es5/Array/range.d.ts +5 -5
- package/module/es5/Array/range.js +28 -10
- package/module/es5/Array/shuffle.d.ts +3 -3
- package/module/es5/Array/shuffle.js +3 -3
- package/module/es5/Array/shuffle2DArray.d.ts +4 -4
- package/module/es5/Array/shuffle2DArray.js +6 -6
- package/module/es5/Array/sum.d.ts +3 -3
- package/module/es5/Array/sum.js +4 -4
- package/module/es5/Array/timSort.d.ts +13 -11
- package/module/es5/Array/timSort.js +36 -9
- package/module/es5/Array/zip.d.ts +6 -3
- package/module/es5/Array/zip.js +6 -3
- package/module/es5/Array/zipLongest.d.ts +8 -5
- package/module/es5/Array/zipLongest.js +8 -5
- package/module/es5/Color/cmykToRgba.d.ts +7 -7
- package/module/es5/Color/cmykToRgba.js +12 -12
- package/module/es5/Color/hexaToRgba.d.ts +4 -3
- package/module/es5/Color/hexaToRgba.js +18 -6
- package/module/es5/Color/hslaToRgba.d.ts +7 -6
- package/module/es5/Color/hslaToRgba.js +19 -13
- package/module/es5/Color/rgbaToCmyk.d.ts +3 -3
- package/module/es5/Color/rgbaToCmyk.js +7 -3
- package/module/es5/Color/rgbaToHexA.d.ts +4 -4
- package/module/es5/Color/rgbaToHexA.js +5 -5
- package/module/es5/Color/rgbaToHsla.d.ts +4 -3
- package/module/es5/Color/rgbaToHsla.js +8 -3
- package/module/es5/Consts/clock.d.ts +11 -11
- package/module/es5/Consts/clock.js +11 -11
- package/module/es5/Consts/httpStatus/httpClientErrorStatus.d.ts +28 -0
- package/module/es5/Consts/httpStatus/httpClientErrorStatus.js +28 -0
- package/module/es5/Consts/httpStatus/httpInformationalStatus.d.ts +9 -0
- package/module/es5/Consts/httpStatus/httpInformationalStatus.js +9 -0
- package/module/es5/Consts/httpStatus/httpRedirectionStatus.d.ts +11 -0
- package/module/es5/Consts/httpStatus/httpRedirectionStatus.js +11 -0
- package/module/es5/Consts/httpStatus/httpServerErrorStatus.d.ts +10 -0
- package/module/es5/Consts/httpStatus/httpServerErrorStatus.js +10 -0
- package/module/es5/Consts/httpStatus/httpSuccessStatus.d.ts +11 -0
- package/module/es5/Consts/httpStatus/httpSuccessStatus.js +11 -0
- package/module/es5/Date/birthday.d.ts +7 -6
- package/module/es5/Date/birthday.js +7 -6
- package/module/es5/Date/dateRange.d.ts +7 -4
- package/module/es5/Date/dateRange.js +7 -4
- package/module/es5/Date/dayOfWeek.d.ts +4 -4
- package/module/es5/Date/dayOfWeek.js +4 -4
- package/module/es5/Date/format.d.ts +30 -4
- package/module/es5/Date/format.js +30 -4
- package/module/es5/Date/getDay.d.ts +8 -5
- package/module/es5/Date/getDay.js +8 -5
- package/module/es5/Date/getTimezoneOffsetString.d.ts +3 -3
- package/module/es5/Date/getTimezoneOffsetString.js +3 -3
- package/module/es5/Date/isLeapYear.d.ts +8 -3
- package/module/es5/Date/isLeapYear.js +8 -3
- package/module/es5/Date/new.d.ts +20 -20
- package/module/es5/Date/new.js +21 -21
- package/module/es5/Date/now.d.ts +7 -4
- package/module/es5/Date/now.js +7 -4
- package/module/es5/Error/safeExecute.d.ts +21 -0
- package/module/es5/Error/safeExecute.js +36 -0
- package/module/es5/IP/cidrToLong.d.ts +4 -3
- package/module/es5/IP/cidrToLong.js +7 -3
- package/module/es5/IP/cidrToSubnetMask.d.ts +4 -3
- package/module/es5/IP/cidrToSubnetMask.js +4 -3
- package/module/es5/IP/getIpClass.d.ts +3 -3
- package/module/es5/IP/getIpClass.js +44 -18
- package/module/es5/IP/getNetworkAddress.d.ts +5 -4
- package/module/es5/IP/getNetworkAddress.js +35 -6
- package/module/es5/IP/ipToBinaryString.d.ts +4 -3
- package/module/es5/IP/ipToBinaryString.js +44 -5
- package/module/es5/IP/ipToLong.d.ts +4 -3
- package/module/es5/IP/ipToLong.js +4 -3
- package/module/es5/IP/isInRange.d.ts +6 -5
- package/module/es5/IP/isInRange.js +34 -7
- package/module/es5/IP/isPrivateIp.d.ts +4 -3
- package/module/es5/IP/isPrivateIp.js +30 -17
- package/module/es5/IP/longToIp.d.ts +4 -3
- package/module/es5/IP/longToIp.js +17 -5
- package/module/es5/IP/subnetMaskToCidr.d.ts +4 -3
- package/module/es5/IP/subnetMaskToCidr.js +33 -12
- package/module/es5/Math/addition.d.ts +3 -3
- package/module/es5/Math/addition.js +3 -3
- package/module/es5/Math/average.d.ts +7 -4
- package/module/es5/Math/average.js +7 -4
- package/module/es5/Math/bitwise.d.ts +5 -5
- package/module/es5/Math/bitwise.js +5 -5
- package/module/es5/Math/calculator/calculator.d.ts +9 -7
- package/module/es5/Math/calculator/calculator.js +9 -7
- package/module/es5/Math/calculator/calculatorInitialization.d.ts +4 -3
- package/module/es5/Math/calculator/calculatorInitialization.js +6 -5
- package/module/es5/Math/calculator/convertCurrency.d.ts +6 -4
- package/module/es5/Math/calculator/convertCurrency.js +6 -4
- package/module/es5/Math/calculator/core.js +13 -13
- package/module/es5/Math/calculator/literalExpression.d.ts +5 -3
- package/module/es5/Math/calculator/literalExpression.js +12 -10
- package/module/es5/Math/degToRad.d.ts +3 -3
- package/module/es5/Math/degToRad.js +3 -3
- package/module/es5/Math/deviationValue.d.ts +5 -5
- package/module/es5/Math/deviationValue.js +5 -5
- package/module/es5/Math/division.d.ts +5 -5
- package/module/es5/Math/division.js +35 -21
- package/module/es5/Math/factorial.d.ts +3 -3
- package/module/es5/Math/factorial.js +3 -3
- package/module/es5/Math/factorize.d.ts +3 -3
- package/module/es5/Math/factorize.js +3 -3
- package/module/es5/Math/flexibleNumberConversion.d.ts +11 -11
- package/module/es5/Math/flexibleNumberConversion.js +19 -19
- package/module/es5/Math/gcd.d.ts +5 -5
- package/module/es5/Math/gcd.js +6 -6
- package/module/es5/Math/getDecimalLength.d.ts +7 -4
- package/module/es5/Math/getDecimalLength.js +9 -5
- package/module/es5/Math/lcm.d.ts +4 -4
- package/module/es5/Math/lcm.js +5 -5
- package/module/es5/Math/linearCongruentialGenerator.d.ts +6 -6
- package/module/es5/Math/linearCongruentialGenerator.js +6 -6
- package/module/es5/Math/mathConverter.d.ts +7 -3
- package/module/es5/Math/mathConverter.js +7 -3
- package/module/es5/Math/mathSeparator.d.ts +8 -3
- package/module/es5/Math/mathSeparator.js +8 -3
- package/module/es5/Math/max.d.ts +4 -3
- package/module/es5/Math/max.js +4 -3
- package/module/es5/Math/median.d.ts +3 -3
- package/module/es5/Math/median.js +3 -3
- package/module/es5/Math/min.d.ts +4 -3
- package/module/es5/Math/min.js +4 -3
- package/module/es5/Math/multiples.d.ts +4 -4
- package/module/es5/Math/multiples.js +4 -4
- package/module/es5/Math/multiplication.d.ts +3 -3
- package/module/es5/Math/multiplication.js +3 -3
- package/module/es5/Math/nCr.d.ts +7 -4
- package/module/es5/Math/nCr.js +7 -4
- package/module/es5/Math/nHr.d.ts +7 -4
- package/module/es5/Math/nHr.js +7 -4
- package/module/es5/Math/nPr.d.ts +7 -4
- package/module/es5/Math/nPr.js +7 -4
- package/module/es5/Math/primeFactorization.d.ts +6 -3
- package/module/es5/Math/primeFactorization.js +11 -8
- package/module/es5/Math/quotient.d.ts +7 -4
- package/module/es5/Math/quotient.js +7 -4
- package/module/es5/Math/radToDeg.d.ts +5 -3
- package/module/es5/Math/radToDeg.js +5 -3
- package/module/es5/Math/random.d.ts +6 -5
- package/module/es5/Math/random.js +6 -5
- package/module/es5/Math/reduce.d.ts +9 -4
- package/module/es5/Math/reduce.js +14 -8
- package/module/es5/Math/repeatedTrial.d.ts +5 -5
- package/module/es5/Math/repeatedTrial.js +5 -5
- package/module/es5/Math/roundOf.d.ts +7 -5
- package/module/es5/Math/roundOf.js +8 -6
- package/module/es5/Math/solveEquation.d.ts +12 -13
- package/module/es5/Math/solveEquation.js +34 -38
- package/module/es5/Math/standardDeviation.d.ts +8 -3
- package/module/es5/Math/standardDeviation.js +16 -7
- package/module/es5/Math/subtract.d.ts +10 -4
- package/module/es5/Math/subtract.js +12 -6
- package/module/es5/Math/toBaseN.d.ts +8 -6
- package/module/es5/Math/toBaseN.js +9 -7
- package/module/es5/Math/toCelsius.d.ts +5 -3
- package/module/es5/Math/toCelsius.js +5 -3
- package/module/es5/Math/toKelvin.d.ts +5 -3
- package/module/es5/Math/toKelvin.js +5 -3
- package/module/es5/Math/uuidv7.d.ts +10 -2
- package/module/es5/Math/uuidv7.js +10 -2
- package/module/es5/Math/valueSwap.d.ts +5 -4
- package/module/es5/Math/valueSwap.js +5 -4
- package/module/es5/Math/xoshiro256.d.ts +8 -3
- package/module/es5/Math/xoshiro256.js +8 -3
- package/module/es5/Object/has.d.ts +4 -4
- package/module/es5/Object/has.js +4 -4
- package/module/es5/Object/keyBy.d.ts +3 -3
- package/module/es5/Object/keyBy.js +4 -4
- package/module/es5/Object/pick.d.ts +6 -6
- package/module/es5/Object/pick.js +6 -6
- package/module/es5/Object/pickDeep.d.ts +7 -7
- package/module/es5/Object/pickDeep.js +7 -7
- package/module/es5/Simple/Array/quickSortSimple.d.ts +9 -7
- package/module/es5/Simple/Array/quickSortSimple.js +7 -6
- package/module/es5/Simple/Date/birthdaySimple.d.ts +4 -4
- package/module/es5/Simple/Date/birthdaySimple.js +4 -4
- package/module/es5/Simple/Date/dayOfWeekSimple.d.ts +4 -4
- package/module/es5/Simple/Date/dayOfWeekSimple.js +4 -4
- package/module/es5/Simple/Date/nowSimple.d.ts +3 -3
- package/module/es5/Simple/Date/nowSimple.js +3 -3
- package/module/es5/Simple/Math/deviationValueSimple.d.ts +10 -11
- package/module/es5/Simple/Math/deviationValueSimple.js +23 -12
- package/module/es5/String/deleteSpaces.d.ts +8 -4
- package/module/es5/String/deleteSpaces.js +8 -4
- package/module/es5/String/formatString.d.ts +8 -8
- package/module/es5/String/formatString.js +7 -7
- package/module/es5/String/fromBase64.d.ts +4 -3
- package/module/es5/String/fromBase64.js +14 -9
- package/module/es5/String/hasNoLetters.d.ts +9 -3
- package/module/es5/String/hasNoLetters.js +12 -6
- package/module/es5/String/padEnd.d.ts +5 -5
- package/module/es5/String/padEnd.js +5 -5
- package/module/es5/String/padStart.d.ts +11 -5
- package/module/es5/String/padStart.js +20 -5
- package/module/es5/String/randomString.d.ts +4 -4
- package/module/es5/String/randomString.js +4 -4
- package/module/es5/String/randomStringInitialization.d.ts +3 -3
- package/module/es5/String/randomStringInitialization.js +3 -3
- package/module/es5/String/reverseString.d.ts +3 -3
- package/module/es5/String/reverseString.js +3 -3
- package/module/es5/String/toBase64.d.ts +3 -3
- package/module/es5/String/toBase64.js +3 -3
- package/module/es5/String/toHalfWidth.d.ts +3 -3
- package/module/es5/String/toHalfWidth.js +3 -3
- package/module/es5/String/trimCharacters.d.ts +4 -4
- package/module/es5/String/trimCharacters.js +4 -4
- package/module/es5/String/trimEndCharacters.d.ts +10 -4
- package/module/es5/String/trimEndCharacters.js +10 -4
- package/module/es5/String/trimStartCharacters.d.ts +10 -4
- package/module/es5/String/trimStartCharacters.js +10 -4
- package/module/es5/Time/convertTime.d.ts +6 -6
- package/module/es5/Time/convertTime.js +12 -11
- package/module/es5/Tool/createPipeline.d.ts +8 -6
- package/module/es5/Tool/createPipeline.js +10 -8
- package/module/es5/Tool/parseJson.d.ts +7 -0
- package/module/es5/Tool/parseJson.js +7 -0
- package/module/es5/UA/extractBrowserFromUserAgent.d.ts +12 -0
- package/module/es5/UA/extractBrowserFromUserAgent.js +22 -5
- package/module/es5/UA/extractDeviceFromUserAgent.d.ts +12 -0
- package/module/es5/UA/extractDeviceFromUserAgent.js +12 -0
- package/module/es5/UA/extractOsFromUserAgent.d.ts +12 -0
- package/module/es5/UA/extractOsFromUserAgent.js +12 -0
- package/module/es5/UA/parseUserAgent.d.ts +16 -0
- package/module/es5/UA/parseUserAgent.js +16 -0
- package/module/es5/Unit/unitConverterInitialization.d.ts +15 -0
- package/module/es5/Unit/unitConverterInitialization.js +15 -0
- package/module/es5/Validate/array/core.d.ts +12 -0
- package/module/es5/Validate/array/core.js +15 -4
- package/module/es5/Validate/boolean/core.d.ts +9 -0
- package/module/es5/Validate/boolean/core.js +10 -0
- package/module/es5/Validate/core/index.d.ts +10 -0
- package/module/es5/Validate/core/index.js +13 -1
- package/module/es5/Validate/isArray.d.ts +3 -3
- package/module/es5/Validate/isArray.js +3 -3
- package/module/es5/Validate/isBrowser.d.ts +1 -1
- package/module/es5/Validate/isBrowser.js +1 -1
- package/module/es5/Validate/isBun.d.ts +1 -1
- package/module/es5/Validate/isBun.js +1 -1
- package/module/es5/Validate/isDictionaryObject.d.ts +3 -3
- package/module/es5/Validate/isDictionaryObject.js +3 -3
- package/module/es5/Validate/isDouble.d.ts +4 -4
- package/module/es5/Validate/isDouble.js +4 -4
- package/module/es5/Validate/isNode.d.ts +1 -1
- package/module/es5/Validate/isNode.js +1 -1
- package/module/es5/Validate/isNodeWebkit.d.ts +1 -1
- package/module/es5/Validate/isNodeWebkit.js +1 -1
- package/module/es5/Validate/isNotEmpty.d.ts +3 -3
- package/module/es5/Validate/isNotEmpty.js +4 -4
- package/module/es5/Validate/isNumber.d.ts +4 -4
- package/module/es5/Validate/isNumber.js +11 -4
- package/module/es5/Validate/isPerfectSquare.d.ts +8 -3
- package/module/es5/Validate/isPerfectSquare.js +8 -3
- package/module/es5/Validate/isPrimeNumber.d.ts +7 -3
- package/module/es5/Validate/isPrimeNumber.js +8 -4
- package/module/es5/Validate/isValueNaN.d.ts +7 -5
- package/module/es5/Validate/isValueNaN.js +7 -5
- package/module/es5/Validate/number/core.d.ts +11 -0
- package/module/es5/Validate/number/core.js +12 -0
- package/module/es5/Validate/number/double.d.ts +9 -0
- package/module/es5/Validate/number/double.js +10 -0
- package/module/es5/Validate/number/even.d.ts +9 -0
- package/module/es5/Validate/number/even.js +10 -0
- package/module/es5/Validate/number/maxValue.d.ts +10 -0
- package/module/es5/Validate/number/maxValue.js +11 -0
- package/module/es5/Validate/number/minValue.d.ts +10 -0
- package/module/es5/Validate/number/minValue.js +11 -0
- package/module/es5/Validate/number/prime.d.ts +9 -0
- package/module/es5/Validate/number/prime.js +10 -0
- package/module/es5/Validate/object/core.d.ts +11 -0
- package/module/es5/Validate/object/core.js +12 -0
- package/module/es5/Validate/string/core.d.ts +11 -0
- package/module/es5/Validate/string/core.js +12 -0
- package/module/es5/Validate/string/email.d.ts +9 -0
- package/module/es5/Validate/string/email.js +11 -1
- package/module/es5/Validate/string/length.d.ts +11 -0
- package/module/es5/Validate/string/length.js +12 -0
- package/module/es5/Validate/string/maxLength.d.ts +10 -0
- package/module/es5/Validate/string/maxLength.js +11 -0
- package/module/es5/Validate/string/minLength.d.ts +10 -0
- package/module/es5/Validate/string/minLength.js +11 -0
- package/module/es5/Validate/string/numberString.d.ts +9 -0
- package/module/es5/Validate/string/numberString.js +10 -0
- package/module/es5/Validate/string/regexMatch.d.ts +10 -0
- package/module/es5/Validate/string/regexMatch.js +11 -0
- package/module/es5/Validate/string/uuid.d.ts +8 -3
- package/module/es5/Validate/string/uuid.js +10 -4
- package/module/es5/Validate/type.d.ts +22 -0
- package/module/es5/tests/integration/Array/drop-and-first.test.js +20 -0
- package/module/es5/tests/integration/Tool/parseJson-and-Validate.test.js +68 -14
- package/module/es5/tests/unit/Array/arraysJoin.test.js +15 -3
- package/module/es5/tests/unit/Array/checkFlagAlignment.test.js +10 -10
- package/module/es5/tests/unit/Array/compact.test.js +17 -17
- package/module/es5/tests/unit/Array/compareFunctionDefault.test.d.ts +1 -0
- package/module/es5/tests/unit/Array/compareFunctionDefault.test.js +29 -0
- package/module/es5/tests/unit/Array/drop.test.js +10 -10
- package/module/es5/tests/unit/Array/dualPivotQuickSort.test.d.ts +1 -0
- package/module/es5/tests/unit/Array/dualPivotQuickSort.test.js +87 -0
- package/module/es5/tests/unit/Array/generateNumberArray.test.js +6 -6
- package/module/es5/tests/unit/Array/getArraysCommon.test.js +36 -4
- package/module/es5/tests/unit/Array/getArraysDiff.test.js +14 -14
- package/module/es5/tests/unit/Array/groupBy.test.js +6 -6
- package/module/es5/tests/unit/Array/insertionSort.test.js +8 -8
- package/module/es5/tests/unit/Array/mergeSort.test.js +34 -5
- package/module/es5/tests/unit/Array/quickSort.test.js +76 -11
- package/module/es5/tests/unit/Array/randomSelect.test.js +11 -6
- package/module/es5/tests/unit/Array/range.test.js +25 -4
- package/module/es5/tests/unit/Array/shuffle.test.js +53 -6
- package/module/es5/tests/unit/Array/shuffle2DArray.test.js +51 -8
- package/module/es5/tests/unit/Array/sum.test.js +40 -2
- package/module/es5/tests/unit/Array/timSort.test.js +89 -9
- package/module/es5/tests/unit/Array/zip.test.js +48 -9
- package/module/es5/tests/unit/Array/zipLongest.test.js +52 -9
- package/module/es5/tests/unit/Color/cmykToRgba.test.js +3 -3
- package/module/es5/tests/unit/Color/hexaToRgba.test.js +53 -1
- package/module/es5/tests/unit/Color/hslaToRgba.test.js +35 -53
- package/module/es5/tests/unit/Color/rgbaToCmyk.test.js +67 -1
- package/module/es5/tests/unit/Color/rgbaToHsla.test.js +91 -1
- package/module/es5/tests/unit/Consts/clock.test.js +51 -18
- package/module/es5/tests/unit/Consts/httpStatus.test.js +9 -0
- package/module/es5/tests/unit/Date/birthday.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/birthday.test.js +31 -0
- package/module/es5/tests/unit/Date/dateRange.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/dateRange.test.js +40 -0
- package/module/es5/tests/unit/Date/dayOfWeek.test.js +5 -5
- package/module/es5/tests/unit/Date/format.test.js +22 -0
- package/module/es5/tests/unit/Date/getDay.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/getDay.test.js +40 -0
- package/module/es5/tests/unit/Date/getTimezoneOffsetString.test.js +3 -3
- package/module/es5/tests/unit/Date/isLeapYear.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/isLeapYear.test.js +30 -0
- package/module/es5/tests/unit/Date/new.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/new.test.js +39 -0
- package/module/es5/tests/unit/Date/now.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/now.test.js +42 -0
- package/module/es5/tests/unit/Error/safeExecute.test.js +69 -15
- package/module/es5/tests/unit/IP/cidrToLong.test.js +27 -5
- package/module/es5/tests/unit/IP/cidrToSubnetMask.test.js +29 -10
- package/module/es5/tests/unit/IP/getIpClass.test.js +29 -18
- package/module/es5/tests/unit/IP/getNetworkAddress.test.js +35 -14
- package/module/es5/tests/unit/IP/ipToBinaryString.test.js +38 -9
- package/module/es5/tests/unit/IP/ipToLong.test.js +27 -13
- package/module/es5/tests/unit/IP/isInRange.test.js +75 -4
- package/module/es5/tests/unit/IP/isPrivateIp.test.js +18 -12
- package/module/es5/tests/unit/IP/longToIp.test.d.ts +1 -0
- package/module/es5/tests/unit/IP/longToIp.test.js +39 -0
- package/module/es5/tests/unit/IP/subnetMaskToCidr.test.js +34 -20
- package/module/es5/tests/unit/Math/average.test.js +40 -18
- package/module/es5/tests/unit/Math/bitwise.test.js +14 -14
- package/module/es5/tests/unit/Math/calculator/calculator.test.js +9 -9
- package/module/es5/tests/unit/Math/calculator/calculatorInitialization.test.js +16 -5
- package/module/es5/tests/unit/Math/calculator/convertCurrency.test.js +12 -12
- package/module/es5/tests/unit/Math/calculator/literalExpression.test.js +8 -8
- package/module/es5/tests/unit/Math/degToRad.test.js +10 -10
- package/module/es5/tests/unit/Math/deviationValue.test.js +12 -12
- package/module/es5/tests/unit/Math/division.test.js +72 -25
- package/module/es5/tests/unit/Math/factorial.test.js +4 -4
- package/module/es5/tests/unit/Math/factorize.test.js +34 -9
- package/module/es5/tests/unit/Math/flexibleNumberConversion.test.js +75 -75
- package/module/es5/tests/unit/Math/gcd.test.js +5 -5
- package/module/es5/tests/unit/Math/getDecimalLength.test.js +40 -4
- package/module/es5/tests/unit/Math/lcm.test.js +16 -9
- package/module/es5/tests/unit/Math/linearCongruentialGenerator.test.js +4 -4
- package/module/es5/tests/unit/Math/mathConverter.test.js +13 -13
- package/module/es5/tests/unit/Math/mathSeparator.test.js +23 -5
- package/module/es5/tests/unit/Math/max.test.js +18 -3
- package/module/es5/tests/unit/Math/median.test.js +4 -4
- package/module/es5/tests/unit/Math/min.test.js +18 -3
- package/module/es5/tests/unit/Math/multiples.test.js +26 -10
- package/module/es5/tests/unit/Math/multiplication.test.js +43 -9
- package/module/es5/tests/unit/Math/nCr.test.js +27 -14
- package/module/es5/tests/unit/Math/nHr.test.js +28 -15
- package/module/es5/tests/unit/Math/nPr.test.js +31 -14
- package/module/es5/tests/unit/Math/primeFactorization.test.js +79 -8
- package/module/es5/tests/unit/Math/quotient.test.js +32 -10
- package/module/es5/tests/unit/Math/radToDeg.test.js +39 -38
- package/module/es5/tests/unit/Math/random.test.js +55 -17
- package/module/es5/tests/unit/Math/reduce.test.js +87 -8
- package/module/es5/tests/unit/Math/repeatedTrial.test.js +35 -5
- package/module/es5/tests/unit/Math/roundOf.test.js +36 -11
- package/module/es5/tests/unit/Math/solveEquation.test.js +20 -20
- package/module/es5/tests/unit/Math/standardDeviation.test.js +19 -2
- package/module/es5/tests/unit/Math/subtract.test.js +14 -2
- package/module/es5/tests/unit/Math/toBaseN.test.js +36 -19
- package/module/es5/tests/unit/Math/toCelsius.test.js +14 -2
- package/module/es5/tests/unit/Math/toKelvin.test.js +14 -2
- package/module/es5/tests/unit/Math/uuidv7.test.js +6 -6
- package/module/es5/tests/unit/Math/valueSwap.test.js +24 -6
- package/module/es5/tests/unit/Math/xoshiro256.test.js +22 -11
- package/module/es5/tests/unit/Object/keyBy.test.js +6 -6
- package/module/es5/tests/unit/Object/pick.test.js +11 -11
- package/module/es5/tests/unit/Object/pickDeep.test.js +15 -15
- package/module/es5/tests/unit/Simple/Array/quickSortSimple.test.js +4 -4
- package/module/es5/tests/unit/Simple/Math/deviationValueSimple.test.js +39 -3
- package/module/es5/tests/unit/String/deleteSpaces.test.d.ts +1 -0
- package/module/es5/tests/unit/String/deleteSpaces.test.js +22 -0
- package/module/es5/tests/unit/String/formatString.test.js +41 -14
- package/module/es5/tests/unit/String/fromBase64.test.js +19 -8
- package/module/es5/tests/unit/String/hasNoLetters.test.js +20 -24
- package/module/es5/tests/unit/String/padEnd.test.js +5 -5
- package/module/es5/tests/unit/String/padStart.test.js +32 -19
- package/module/es5/tests/unit/String/randomString.test.js +3 -3
- package/module/es5/tests/unit/String/randomStringInitialization.test.js +2 -2
- package/module/es5/tests/unit/String/reverseString.test.js +10 -12
- package/module/es5/tests/unit/String/toBase64.test.js +5 -5
- package/module/es5/tests/unit/String/toHalfWidth.test.js +3 -3
- package/module/es5/tests/unit/String/trimCharacters.test.js +4 -4
- package/module/es5/tests/unit/String/trimEndCharacters.test.js +17 -7
- package/module/es5/tests/unit/String/trimStartCharacters.test.js +23 -10
- package/module/es5/tests/unit/Time/convertTime.test.js +40 -46
- package/module/es5/tests/unit/Tool/createPipeline.test.js +15 -15
- package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.d.ts +1 -0
- package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.js +47 -0
- package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.d.ts +1 -0
- package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.js +55 -0
- package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.d.ts +1 -0
- package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.js +57 -0
- package/module/es5/tests/unit/Unit/unitConverterInitialization.test.js +27 -25
- package/module/es5/tests/unit/Validate/array/core.test.js +39 -10
- package/module/es5/tests/unit/Validate/core/core.test.d.ts +1 -0
- package/module/es5/tests/unit/Validate/core/core.test.js +87 -0
- package/module/es5/tests/unit/Validate/isArray.test.js +11 -0
- package/module/es5/tests/unit/Validate/isDictionaryObject.test.js +15 -1
- package/module/es5/tests/unit/Validate/isDouble.test.js +21 -4
- package/module/es5/tests/unit/Validate/isNotEmpty.test.js +3 -3
- package/module/es5/tests/unit/Validate/isNumber.test.js +67 -29
- package/module/es5/tests/unit/Validate/isPerfectSquare.test.js +5 -0
- package/module/es5/tests/unit/Validate/isPrimeNumber.test.js +14 -4
- package/module/es5/tests/unit/Validate/isValueNaN.test.js +50 -11
- package/module/es5/tests/unit/Validate/string/uuid.test.js +13 -13
- package/module/es5/tsconfig.tsbuildinfo +1 -1
- package/module/es5/types/array/compareFunction.d.ts +2 -0
- package/module/es5/types/array/compareFunction.js +5 -0
- package/module/es5/types/time/timeUnit.d.ts +1 -1
- package/module/types/array/compareFunction.d.ts +2 -0
- package/module/types/array/compareFunction.js +2 -0
- package/module/types/array/compareFunction.js.map +1 -0
- package/module/types/time/timeUnit.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
var _getTimezoneOffsetString = require("@/Date/getTimezoneOffsetString");
|
|
4
4
|
describe("getTimezoneOffsetString", function () {
|
|
5
|
-
it("
|
|
5
|
+
it("should handle positive timezone offset", function () {
|
|
6
6
|
var date = new Date("2023-01-01T12:00:00Z");
|
|
7
7
|
date.getTimezoneOffset = function () {
|
|
8
8
|
return -480;
|
|
9
9
|
}; // UTC+8
|
|
10
10
|
expect((0, _getTimezoneOffsetString.getTimezoneOffsetString)(date)).toBe("+08:00");
|
|
11
11
|
});
|
|
12
|
-
it("
|
|
12
|
+
it("should handle negative timezone offset", function () {
|
|
13
13
|
var date = new Date("2023-01-01T12:00:00Z");
|
|
14
14
|
date.getTimezoneOffset = function () {
|
|
15
15
|
return 300;
|
|
16
16
|
}; // UTC-5
|
|
17
17
|
expect((0, _getTimezoneOffsetString.getTimezoneOffsetString)(date)).toBe("-05:00");
|
|
18
18
|
});
|
|
19
|
-
it("
|
|
19
|
+
it("should handle zero timezone offset", function () {
|
|
20
20
|
var date = new Date("2023-01-01T12:00:00Z");
|
|
21
21
|
date.getTimezoneOffset = function () {
|
|
22
22
|
return 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _isLeapYear = require("@/Date/isLeapYear");
|
|
4
|
+
describe("isLeapYear", function () {
|
|
5
|
+
it("should return true for years divisible by 4 but not by 100", function () {
|
|
6
|
+
expect((0, _isLeapYear.isLeapYear)(2020)).toBe(true);
|
|
7
|
+
expect((0, _isLeapYear.isLeapYear)(2024)).toBe(true);
|
|
8
|
+
expect((0, _isLeapYear.isLeapYear)(1996)).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
it("should return false for years divisible by 100 but not by 400", function () {
|
|
11
|
+
expect((0, _isLeapYear.isLeapYear)(1900)).toBe(false);
|
|
12
|
+
expect((0, _isLeapYear.isLeapYear)(2100)).toBe(false);
|
|
13
|
+
expect((0, _isLeapYear.isLeapYear)(1700)).toBe(false);
|
|
14
|
+
});
|
|
15
|
+
it("should return true for years divisible by 400", function () {
|
|
16
|
+
expect((0, _isLeapYear.isLeapYear)(2000)).toBe(true);
|
|
17
|
+
expect((0, _isLeapYear.isLeapYear)(1600)).toBe(true);
|
|
18
|
+
expect((0, _isLeapYear.isLeapYear)(2400)).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it("should return false for non-leap years", function () {
|
|
21
|
+
expect((0, _isLeapYear.isLeapYear)(2023)).toBe(false);
|
|
22
|
+
expect((0, _isLeapYear.isLeapYear)(2025)).toBe(false);
|
|
23
|
+
expect((0, _isLeapYear.isLeapYear)(1997)).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
it("should handle early years", function () {
|
|
26
|
+
expect((0, _isLeapYear.isLeapYear)(4)).toBe(true);
|
|
27
|
+
expect((0, _isLeapYear.isLeapYear)(100)).toBe(false);
|
|
28
|
+
expect((0, _isLeapYear.isLeapYear)(400)).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _new = require("@/Date/new");
|
|
4
|
+
describe("newDateInt", function () {
|
|
5
|
+
it("should create date with components matching input values", function () {
|
|
6
|
+
var date = (0, _new.newDateInt)(2025, 1, 1);
|
|
7
|
+
expect(date.getFullYear()).toBe(2025);
|
|
8
|
+
expect(date.getMonth()).toBe(0); // 0-based month
|
|
9
|
+
expect(date.getDate()).toBe(1);
|
|
10
|
+
});
|
|
11
|
+
it("should create date with all time components matching input values", function () {
|
|
12
|
+
var date = (0, _new.newDateInt)(2025, 1, 1, 10, 30, 45, 500);
|
|
13
|
+
expect(date.getFullYear()).toBe(2025);
|
|
14
|
+
expect(date.getMonth()).toBe(0);
|
|
15
|
+
expect(date.getDate()).toBe(1);
|
|
16
|
+
expect(date.getHours()).toBe(10);
|
|
17
|
+
expect(date.getMinutes()).toBe(30);
|
|
18
|
+
expect(date.getSeconds()).toBe(45);
|
|
19
|
+
expect(date.getMilliseconds()).toBe(500);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
describe("newDateString", function () {
|
|
23
|
+
it("should create date with default time values", function () {
|
|
24
|
+
var date = (0, _new.newDateString)("2025-01-01");
|
|
25
|
+
// Use toISOString to check the UTC time, which should be midnight
|
|
26
|
+
expect(date.toISOString()).toBe("2025-01-01T00:00:00.000Z");
|
|
27
|
+
});
|
|
28
|
+
it("should create date with specific time components", function () {
|
|
29
|
+
var date = (0, _new.newDateString)("2025-01-01", "10", "30", "45", "500", "09");
|
|
30
|
+
expect(date.toISOString()).toBe("2025-01-01T01:30:45.500Z"); // UTC+9 -> UTC
|
|
31
|
+
});
|
|
32
|
+
it("should handle different timezone offsets", function () {
|
|
33
|
+
var dateUTC = (0, _new.newDateString)("2025-01-01", "12", "00", "00", "000", "00");
|
|
34
|
+
var dateJST = (0, _new.newDateString)("2025-01-01", "12", "00", "00", "000", "09");
|
|
35
|
+
|
|
36
|
+
// JST (UTC+9) date should be 9 hours behind UTC date
|
|
37
|
+
expect(dateJST.getTime()).toBe(dateUTC.getTime() - 9 * 60 * 60 * 1000);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _now = require("@/Date/now");
|
|
4
|
+
describe("now", function () {
|
|
5
|
+
var FIXED_TIME = 1712192400000; // 2024-04-04T01:00:00.000Z (confirmed with Date object)
|
|
6
|
+
|
|
7
|
+
beforeEach(function () {
|
|
8
|
+
// Mock Date.now() to return a fixed timestamp
|
|
9
|
+
jest.spyOn(Date, "now").mockImplementation(function () {
|
|
10
|
+
return FIXED_TIME;
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
afterEach(function () {
|
|
14
|
+
jest.restoreAllMocks();
|
|
15
|
+
});
|
|
16
|
+
it("should return current time in JST by default", function () {
|
|
17
|
+
var result = (0, _now.now)();
|
|
18
|
+
// Expected: 2024-04-04T10:00:00.000Z (FIXED_TIME + 9 hours)
|
|
19
|
+
expect(result.toISOString()).toBe("2024-04-04T10:00:00.000Z");
|
|
20
|
+
});
|
|
21
|
+
it("should return UTC time when offset is 0", function () {
|
|
22
|
+
var result = (0, _now.now)(0);
|
|
23
|
+
// Expected: 2024-04-04T01:00:00.000Z (FIXED_TIME + 0 hours)
|
|
24
|
+
expect(result.toISOString()).toBe("2024-04-04T01:00:00.000Z");
|
|
25
|
+
});
|
|
26
|
+
it("should handle different UTC offsets", function () {
|
|
27
|
+
// Test UTC+1 (CET)
|
|
28
|
+
var resultCET = (0, _now.now)(1);
|
|
29
|
+
expect(resultCET.toISOString()).toBe("2024-04-04T02:00:00.000Z");
|
|
30
|
+
|
|
31
|
+
// Test UTC+8 (CST)
|
|
32
|
+
var resultCST = (0, _now.now)(8);
|
|
33
|
+
expect(resultCST.toISOString()).toBe("2024-04-04T09:00:00.000Z");
|
|
34
|
+
});
|
|
35
|
+
it("should return correct time difference between timezones", function () {
|
|
36
|
+
var utcResult = (0, _now.now)(0);
|
|
37
|
+
var jstResult = (0, _now.now)(9);
|
|
38
|
+
|
|
39
|
+
// JST should be 9 hours ahead of UTC
|
|
40
|
+
expect(jstResult.getTime() - utcResult.getTime()).toBe(9 * 60 * 60 * 1000);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -1,21 +1,75 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _safeExecute = require("@/Error/safeExecute");
|
|
4
|
-
describe("
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
describe("safeExecute function", function () {
|
|
5
|
+
describe("successful operations", function () {
|
|
6
|
+
it("should return success type with string value", function () {
|
|
7
|
+
var successfulOperation = function successfulOperation() {
|
|
8
|
+
return "test";
|
|
9
|
+
};
|
|
10
|
+
var result = (0, _safeExecute.safeExecute)(successfulOperation);
|
|
11
|
+
expect(result).toEqual({
|
|
12
|
+
type: "success",
|
|
13
|
+
value: "test"
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
it("should return success type with number value", function () {
|
|
17
|
+
var successfulOperation = function successfulOperation() {
|
|
18
|
+
return 42;
|
|
19
|
+
};
|
|
20
|
+
var result = (0, _safeExecute.safeExecute)(successfulOperation);
|
|
21
|
+
expect(result).toEqual({
|
|
22
|
+
type: "success",
|
|
23
|
+
value: 42
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
it("should return success type with object value", function () {
|
|
27
|
+
var testObject = {
|
|
28
|
+
key: "value"
|
|
29
|
+
};
|
|
30
|
+
var successfulOperation = function successfulOperation() {
|
|
31
|
+
return testObject;
|
|
32
|
+
};
|
|
33
|
+
var result = (0, _safeExecute.safeExecute)(successfulOperation);
|
|
34
|
+
expect(result).toEqual({
|
|
35
|
+
type: "success",
|
|
36
|
+
value: testObject
|
|
37
|
+
});
|
|
38
|
+
});
|
|
12
39
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
40
|
+
describe("error handling", function () {
|
|
41
|
+
it("should return error type with Error instance", function () {
|
|
42
|
+
var errorOperation = function errorOperation() {
|
|
43
|
+
throw new Error("test error");
|
|
44
|
+
};
|
|
45
|
+
var result = (0, _safeExecute.safeExecute)(errorOperation);
|
|
46
|
+
expect(result.type).toBe("error");
|
|
47
|
+
if (result.type === "error") {
|
|
48
|
+
expect(result.error).toBeInstanceOf(Error);
|
|
49
|
+
expect(result.error.message).toBe("test error");
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
it("should return error type with custom error message", function () {
|
|
53
|
+
var customError = new TypeError("custom type error");
|
|
54
|
+
var errorOperation = function errorOperation() {
|
|
55
|
+
throw customError;
|
|
56
|
+
};
|
|
57
|
+
var result = (0, _safeExecute.safeExecute)(errorOperation);
|
|
58
|
+
expect(result.type).toBe("error");
|
|
59
|
+
if (result.type === "error") {
|
|
60
|
+
expect(result.error).toBe(customError);
|
|
61
|
+
expect(result.error.message).toBe("custom type error");
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
it("should handle non-Error thrown values", function () {
|
|
65
|
+
var errorOperation = function errorOperation() {
|
|
66
|
+
throw "string error";
|
|
67
|
+
};
|
|
68
|
+
var result = (0, _safeExecute.safeExecute)(errorOperation);
|
|
69
|
+
expect(result.type).toBe("error");
|
|
70
|
+
if (result.type === "error") {
|
|
71
|
+
expect(result.error).toBe("string error");
|
|
72
|
+
}
|
|
73
|
+
});
|
|
20
74
|
});
|
|
21
75
|
});
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _cidrToLong = require("@/IP/cidrToLong");
|
|
4
|
-
describe("cidrToLong
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
describe("cidrToLong", function () {
|
|
5
|
+
describe("valid CIDR values", function () {
|
|
6
|
+
test.each([
|
|
7
|
+
// [CIDR, expected subnet mask value]
|
|
8
|
+
[32, 0xffffffff],
|
|
9
|
+
// 255.255.255.255
|
|
10
|
+
[24, 0xffffff00],
|
|
11
|
+
// 255.255.255.0
|
|
12
|
+
[16, 0xffff0000],
|
|
13
|
+
// 255.255.0.0
|
|
14
|
+
[8, 0xff000000],
|
|
15
|
+
// 255.0.0.0
|
|
16
|
+
[0, 0x00000000],
|
|
17
|
+
// 0.0.0.0
|
|
18
|
+
[1, 0x80000000],
|
|
19
|
+
// 128.0.0.0
|
|
20
|
+
[31, 0xfffffffe] // 255.255.255.254
|
|
21
|
+
])("should convert CIDR %i to subnet mask %i", function (cidr, expected) {
|
|
22
|
+
expect((0, _cidrToLong.cidrToLong)(cidr)).toBe(expected);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
describe("invalid CIDR values", function () {
|
|
26
|
+
test.each([[-1, "CIDR must be an integer between 0 and 32"], [33, "CIDR must be an integer between 0 and 32"], [3.5, "CIDR must be an integer between 0 and 32"], [Number.NaN, "CIDR must be an integer between 0 and 32"], [Number.POSITIVE_INFINITY, "CIDR must be an integer between 0 and 32"]])("should throw error for invalid CIDR %p", function (cidr, expectedError) {
|
|
27
|
+
expect(function () {
|
|
28
|
+
return (0, _cidrToLong.cidrToLong)(cidr);
|
|
29
|
+
}).toThrow(expectedError);
|
|
30
|
+
});
|
|
9
31
|
});
|
|
10
32
|
});
|
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _cidrToSubnetMask = require("@/IP/cidrToSubnetMask");
|
|
4
|
-
// cidrToSubnetMask.test.ts
|
|
5
|
-
|
|
6
4
|
describe("cidrToSubnetMask", function () {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
describe("valid CIDR values", function () {
|
|
6
|
+
test.each([
|
|
7
|
+
// [CIDR, expected subnet mask]
|
|
8
|
+
[32, "255.255.255.255"],
|
|
9
|
+
// Full mask
|
|
10
|
+
[24, "255.255.255.0"],
|
|
11
|
+
// Common class C
|
|
12
|
+
[16, "255.255.0.0"],
|
|
13
|
+
// Common class B
|
|
14
|
+
[8, "255.0.0.0"],
|
|
15
|
+
// Common class A
|
|
16
|
+
[0, "0.0.0.0"],
|
|
17
|
+
// No mask
|
|
18
|
+
[1, "128.0.0.0"],
|
|
19
|
+
// First bit
|
|
20
|
+
[31, "255.255.255.254"],
|
|
21
|
+
// Second to last
|
|
22
|
+
[28, "255.255.255.240"],
|
|
23
|
+
// Common subnet
|
|
24
|
+
[20, "255.255.240.0"] // Less common subnet
|
|
25
|
+
])("should convert CIDR /%i to subnet mask %s", function (cidr, expected) {
|
|
26
|
+
expect((0, _cidrToSubnetMask.cidrToSubnetMask)(cidr)).toBe(expected);
|
|
27
|
+
});
|
|
13
28
|
});
|
|
14
|
-
|
|
15
|
-
|
|
29
|
+
describe("invalid CIDR values", function () {
|
|
30
|
+
test.each([[-1, "CIDR must be an integer between 0 and 32"], [33, "CIDR must be an integer between 0 and 32"], [3.5, "CIDR must be an integer between 0 and 32"], [Number.NaN, "CIDR must be an integer between 0 and 32"], [Number.POSITIVE_INFINITY, "CIDR must be an integer between 0 and 32"]])("should throw error for invalid CIDR %p", function (cidr, expectedError) {
|
|
31
|
+
expect(function () {
|
|
32
|
+
return (0, _cidrToSubnetMask.cidrToSubnetMask)(cidr);
|
|
33
|
+
}).toThrow(expectedError);
|
|
34
|
+
});
|
|
16
35
|
});
|
|
17
36
|
});
|
|
@@ -2,24 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
var _getIpClass = require("@/IP/getIpClass");
|
|
4
4
|
describe("getIpClass", function () {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
describe("valid IP addresses", function () {
|
|
6
|
+
test.each([
|
|
7
|
+
// [IP address, expected class]
|
|
8
|
+
["1.0.0.0", "A"],
|
|
9
|
+
// Start of class A
|
|
10
|
+
["126.0.0.1", "A"],
|
|
11
|
+
// End of class A
|
|
12
|
+
["128.0.0.1", "B"],
|
|
13
|
+
// Start of class B
|
|
14
|
+
["191.255.0.1", "B"],
|
|
15
|
+
// End of class B
|
|
16
|
+
["192.0.0.1", "C"],
|
|
17
|
+
// Start of class C
|
|
18
|
+
["223.255.0.1", "C"],
|
|
19
|
+
// End of class C
|
|
20
|
+
["224.0.0.1", "D"],
|
|
21
|
+
// Start of class D
|
|
22
|
+
["239.0.0.1", "D"],
|
|
23
|
+
// End of class D
|
|
24
|
+
["240.0.0.1", "E"],
|
|
25
|
+
// Start of class E
|
|
26
|
+
["255.255.255.255", "E"] // End of class E
|
|
27
|
+
])("should identify %s as class %s", function (ip, expectedClass) {
|
|
28
|
+
expect((0, _getIpClass.getIpClass)(ip)).toBe(expectedClass);
|
|
29
|
+
});
|
|
8
30
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
expect((0, _getIpClass.getIpClass)("192.0.2.1")).toBe("C");
|
|
14
|
-
});
|
|
15
|
-
test("IPクラスDを識別する", function () {
|
|
16
|
-
expect((0, _getIpClass.getIpClass)("224.0.0.1")).toBe("D");
|
|
17
|
-
});
|
|
18
|
-
test("IPクラスEを識別する", function () {
|
|
19
|
-
expect((0, _getIpClass.getIpClass)("240.0.0.1")).toBe("E");
|
|
20
|
-
});
|
|
21
|
-
test("無効な範囲のIPアドレス", function () {
|
|
22
|
-
expect((0, _getIpClass.getIpClass)("")).toBe("");
|
|
23
|
-
expect((0, _getIpClass.getIpClass)("256.0.0.1")).toBe("");
|
|
31
|
+
describe("invalid IP addresses", function () {
|
|
32
|
+
test.each([["", "empty string"], ["0.0.0.0", "reserved address"], ["256.0.0.1", "first octet > 255"], ["192.168", "incomplete IP"], ["192.168.1.1.1", "too many octets"], ["a.b.c.d", "non-numeric octets"], ["192.168.1", "too few octets"], ["-1.0.0.0", "negative octet"], ["1.2.3.4.5", "too many segments"]])("should return empty string for %s (%s)", function (ip) {
|
|
33
|
+
expect((0, _getIpClass.getIpClass)(ip)).toBe("");
|
|
34
|
+
});
|
|
24
35
|
});
|
|
25
36
|
});
|
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _getNetworkAddress = require("@/IP/getNetworkAddress");
|
|
4
|
-
describe("getNetworkAddress
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
//
|
|
4
|
+
describe("getNetworkAddress", function () {
|
|
5
|
+
describe("valid IP addresses and subnet masks", function () {
|
|
6
|
+
test.each([
|
|
7
|
+
// [IP address, subnet mask, expected network address]
|
|
8
|
+
["192.168.1.1", "255.255.255.0", 0xc0a80100],
|
|
9
|
+
// Common Class C network
|
|
10
|
+
["172.16.5.1", "255.255.0.0", 0xac100000],
|
|
11
|
+
// Common Class B network
|
|
12
|
+
["10.0.0.15", "255.0.0.0", 0x0a000000],
|
|
13
|
+
// Common Class A network
|
|
14
|
+
["192.168.1.1", "255.255.254.0", 0xc0a80000],
|
|
15
|
+
// Non-standard subnet mask
|
|
16
|
+
["255.255.255.255", "255.255.255.0", 0xffffff00],
|
|
17
|
+
// All host bits set
|
|
18
|
+
["0.0.0.0", "255.255.255.0", 0x00000000],
|
|
19
|
+
// All bits zero
|
|
20
|
+
["192.168.1.1", "255.255.255.252", 0xc0a80100],
|
|
21
|
+
// Small subnet (/30)
|
|
22
|
+
["10.10.10.10", "255.255.255.240", 0x0a0a0a00] // Subnet mask with /28
|
|
23
|
+
])("should calculate network address for %s with mask %s", function (ip, mask, expected) {
|
|
24
|
+
expect((0, _getNetworkAddress.getNetworkAddress)(ip, mask)).toBe(expected);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe("invalid inputs", function () {
|
|
28
|
+
test.each([[undefined, "255.255.255.0", "IP address is required"], ["192.168.1.1", undefined, "Subnet mask is required"], ["", "255.255.255.0", "IP address is required"], ["192.168.1.1", "", "Subnet mask is required"], ["invalid", "255.255.255.0", "Invalid IP address or subnet mask"], ["192.168.1.1", "invalid", "Invalid IP address or subnet mask"], ["256.256.256.256", "255.255.255.0", "Invalid IP address or subnet mask"], ["192.168.1.1", "256.256.256.256", "Invalid IP address or subnet mask"]])("should throw error for %s and %s: %s", function (ip, mask, expectedError) {
|
|
29
|
+
expect(function () {
|
|
30
|
+
return (0, _getNetworkAddress.getNetworkAddress)(ip, mask);
|
|
31
|
+
}).toThrow(expectedError);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
test("should handle internal function exceptions", function () {
|
|
35
|
+
// Test for exception handling in catch block (line 49)
|
|
36
|
+
expect(function () {
|
|
37
|
+
return (0, _getNetworkAddress.getNetworkAddress)("192.168.1.1", "255.255.128.3");
|
|
38
|
+
}).toThrow("Invalid IP address or subnet mask");
|
|
18
39
|
});
|
|
19
40
|
});
|
|
@@ -2,16 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
var _ipToBinaryString = require("@/IP/ipToBinaryString");
|
|
4
4
|
describe("ipToBinaryString", function () {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
describe("valid IP addresses", function () {
|
|
6
|
+
test.each([
|
|
7
|
+
// [IP address, expected binary string]
|
|
8
|
+
["192.168.0.1", "11000000101010000000000000000001"],
|
|
9
|
+
// Common private network
|
|
10
|
+
["0.0.0.0", "00000000000000000000000000000000"],
|
|
11
|
+
// All zeros
|
|
12
|
+
["255.255.255.255", "11111111111111111111111111111111"],
|
|
13
|
+
// All ones
|
|
14
|
+
["1.2.3.4", "00000001000000100000001100000100"],
|
|
15
|
+
// Single digit octets
|
|
16
|
+
["10.0.0.1", "00001010000000000000000000000001"],
|
|
17
|
+
// Class A private
|
|
18
|
+
["172.16.0.1", "10101100000100000000000000000001"],
|
|
19
|
+
// Class B private
|
|
20
|
+
["127.0.0.1", "01111111000000000000000000000001"],
|
|
21
|
+
// Localhost
|
|
22
|
+
["169.254.0.1", "10101001111111100000000000000001"] // Link-local
|
|
23
|
+
])("should convert %s to binary", function (ip, expected) {
|
|
24
|
+
expect((0, _ipToBinaryString.ipToBinaryString)(ip)).toBe(expected);
|
|
25
|
+
});
|
|
7
26
|
});
|
|
8
|
-
|
|
9
|
-
|
|
27
|
+
describe("invalid IP addresses", function () {
|
|
28
|
+
test.each([[undefined, "IP address is required"], ["", "IP address is required"], ["192.168", "Invalid IP address format"], ["a.b.c.d", "Invalid IP address format"], ["256.1.2.3", "Invalid IP address format"], ["-1.1.1.1", "Invalid IP address format"], ["1.2.3.4.5", "Invalid IP address format"], ["192.168.1", "Invalid IP address format"], ["192.168.1.1.1", "Invalid IP address format"], ["192.168.1.", "Invalid IP address format"], ["192.168..1", "Invalid IP address format"], [".192.168.1", "Invalid IP address format"], ["192,168,1,1", "Invalid IP address format"], ["192.168.1.1.", "Invalid IP address format"], ["192.168.1.+1", "Invalid IP address format"], ["256.256.256.256", "Invalid IP address format"], ["999.999.999.999", "Invalid IP address format"]])("should throw error for %s: %s", function (ip, expectedError) {
|
|
29
|
+
expect(function () {
|
|
30
|
+
return (0, _ipToBinaryString.ipToBinaryString)(ip);
|
|
31
|
+
}).toThrow(expectedError);
|
|
32
|
+
});
|
|
10
33
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
34
|
+
describe("edge cases", function () {
|
|
35
|
+
test.each([
|
|
36
|
+
// [IP address, expected binary string]
|
|
37
|
+
["0.0.0.0", "00000000000000000000000000000000"], ["1.1.1.1", "00000001000000010000000100000001"], ["255.255.255.255", "11111111111111111111111111111111"], ["128.0.0.0", "10000000000000000000000000000000"], ["0.255.0.255", "00000000111111110000000011111111"]])("should handle boundary values: %s", function (ip, expected) {
|
|
38
|
+
expect((0, _ipToBinaryString.ipToBinaryString)(ip)).toBe(expected);
|
|
39
|
+
});
|
|
40
|
+
test.each(["0000", "00.00", "0.0.0", "192.168.01.1", "192.168.1.01", "010.020.030.040"])("should reject IP with invalid format: %s", function (ip) {
|
|
41
|
+
expect(function () {
|
|
42
|
+
return (0, _ipToBinaryString.ipToBinaryString)(ip);
|
|
43
|
+
}).toThrow("Invalid IP address format");
|
|
44
|
+
});
|
|
16
45
|
});
|
|
17
46
|
});
|
|
@@ -2,19 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
var _ipToLong = require("@/IP/ipToLong");
|
|
4
4
|
describe("ipToLong", function () {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
describe("valid IP addresses", function () {
|
|
6
|
+
test.each([
|
|
7
|
+
// [IP address, expected long value]
|
|
8
|
+
["192.168.0.1", 0xc0a80001],
|
|
9
|
+
// Common private network
|
|
10
|
+
["128.0.0.1", 0x80000001],
|
|
11
|
+
// Class B start
|
|
12
|
+
["10.0.0.1", 0x0a000001],
|
|
13
|
+
// Class A private
|
|
14
|
+
["172.16.0.1", 0xac100001],
|
|
15
|
+
// Class B private
|
|
16
|
+
["255.255.255.255", 0xffffffff],
|
|
17
|
+
// Maximum value
|
|
18
|
+
["0.0.0.0", 0x00000000],
|
|
19
|
+
// Minimum value
|
|
20
|
+
["127.0.0.1", 0x7f000001],
|
|
21
|
+
// Localhost
|
|
22
|
+
["1.2.3.4", 0x01020304] // Simple incremental
|
|
23
|
+
])("should convert %s to %i", function (ip, expected) {
|
|
24
|
+
expect((0, _ipToLong.ipToLong)(ip)).toBe(expected);
|
|
25
|
+
});
|
|
7
26
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
it("空の文字列が渡された場合、0に変換される", function () {
|
|
15
|
-
expect((0, _ipToLong.ipToLong)("")).toBe(0);
|
|
16
|
-
});
|
|
17
|
-
it("範囲外のIPアドレスの場合、0に変換される", function () {
|
|
18
|
-
expect((0, _ipToLong.ipToLong)("256.0.0.0")).toBe(0);
|
|
27
|
+
describe("invalid IP addresses", function () {
|
|
28
|
+
test.each([[undefined, "IP address is required"], ["", "IP address is required"], ["192.168", "Invalid IP address format"], ["256.1.2.3", "Invalid IP address format"], ["a.b.c.d", "Invalid IP address format"], ["-1.0.0.0", "Invalid IP address format"], ["192.168.1.1.1", "Invalid IP address format"], ["192.168..1", "Invalid IP address format"]])("should throw error for %s: %s", function (ip, expectedError) {
|
|
29
|
+
expect(function () {
|
|
30
|
+
return (0, _ipToLong.ipToLong)(ip);
|
|
31
|
+
}).toThrow(expectedError);
|
|
32
|
+
});
|
|
19
33
|
});
|
|
20
34
|
});
|
|
@@ -2,10 +2,81 @@
|
|
|
2
2
|
|
|
3
3
|
var _isInRange = require("@/IP/isInRange");
|
|
4
4
|
describe("isInRange", function () {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
describe("valid IP ranges", function () {
|
|
6
|
+
test.each([
|
|
7
|
+
// [remoteIp, networkIp, cidr, expected]
|
|
8
|
+
["192.168.1.2", "192.168.1.0", 24, true],
|
|
9
|
+
// Common class C network
|
|
10
|
+
["192.168.2.2", "192.168.1.0", 24, false],
|
|
11
|
+
// Outside class C network
|
|
12
|
+
["10.0.0.5", "10.0.0.0", 8, true],
|
|
13
|
+
// Class A network
|
|
14
|
+
["11.0.0.5", "10.0.0.0", 8, false],
|
|
15
|
+
// Outside class A network
|
|
16
|
+
["172.16.1.1", "172.16.0.0", 16, true],
|
|
17
|
+
// Class B network
|
|
18
|
+
["172.17.1.1", "172.16.0.0", 16, false],
|
|
19
|
+
// Outside class B network
|
|
20
|
+
["192.168.1.0", "192.168.1.0", 32, true],
|
|
21
|
+
// Single host network - exact match
|
|
22
|
+
["192.168.1.1", "192.168.1.1", 32, true],
|
|
23
|
+
// Single host network - exact match
|
|
24
|
+
["192.168.1.1", "192.168.1.0", 32, false],
|
|
25
|
+
// Single host network - different IP
|
|
26
|
+
["192.168.1.1", "192.168.1.0", 30, true],
|
|
27
|
+
// Small subnet
|
|
28
|
+
["192.168.1.4", "192.168.1.0", 30, false],
|
|
29
|
+
// Outside small subnet
|
|
30
|
+
["0.0.0.1", "0.0.0.0", 0, true],
|
|
31
|
+
// All IPs in range (CIDR 0)
|
|
32
|
+
["255.255.255.255", "0.0.0.0", 0, true] // All IPs in range (CIDR 0)
|
|
33
|
+
])("should evaluate if %s is in network %s/%i => %s", function (remoteIp, networkIp, cidr, expected) {
|
|
34
|
+
expect((0, _isInRange.isInRange)(remoteIp, networkIp, cidr)).toBe(expected);
|
|
35
|
+
});
|
|
36
|
+
test.each([
|
|
37
|
+
// [remoteIp, networkIp, cidr, description]
|
|
38
|
+
["192.168.1.1", "0.0.0.0", 0, "CIDR 0: all IPs in range"], ["192.168.1.0", "192.168.1.0", 32, "CIDR 32: exact match only"], ["192.168.1.1", "192.168.1.0", 31, "CIDR 31: two IPs"], ["192.168.1.1", "192.168.1.0", 1, "CIDR 1: half of all IPs"]])("should handle %s (%s)", function (ip, network, cidr) {
|
|
39
|
+
expect((0, _isInRange.isInRange)(ip, network, cidr)).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
test("should correctly handle edge cases with specific CIDR masks", function () {
|
|
42
|
+
expect((0, _isInRange.isInRange)("192.168.1.5", "192.168.1.0", 24)).toBe(true);
|
|
43
|
+
expect((0, _isInRange.isInRange)("192.168.2.0", "192.168.1.0", 24)).toBe(false);
|
|
44
|
+
expect((0, _isInRange.isInRange)("192.168.1.0", "192.168.1.0", 31)).toBe(true);
|
|
45
|
+
expect((0, _isInRange.isInRange)("192.168.1.1", "192.168.1.0", 31)).toBe(true);
|
|
46
|
+
expect((0, _isInRange.isInRange)("192.168.1.2", "192.168.1.0", 31)).toBe(false);
|
|
47
|
+
expect((0, _isInRange.isInRange)("192.168.1.3", "192.168.1.0", 30)).toBe(true);
|
|
48
|
+
expect((0, _isInRange.isInRange)("192.168.1.4", "192.168.1.4", 30)).toBe(true);
|
|
49
|
+
});
|
|
7
50
|
});
|
|
8
|
-
|
|
9
|
-
|
|
51
|
+
describe("invalid inputs", function () {
|
|
52
|
+
test.each([[undefined, "192.168.1.0", 24, "Remote IP address is required"], ["192.168.1.1", undefined, 24, "Network IP address is required"], ["", "192.168.1.0", 24, "Remote IP address is required"], ["192.168.1.1", "", 24, "Network IP address is required"], ["192.168.1.1", "192.168.1.0", undefined, "CIDR must be an integer between 0 and 32"], ["192.168.1.1", "192.168.1.0", -1, "CIDR must be an integer between 0 and 32"], ["192.168.1.1", "192.168.1.0", 33, "CIDR must be an integer between 0 and 32"], ["192.168.1.1", "192.168.1.0", 1.5, "CIDR must be an integer between 0 and 32"]])("should throw error for remoteIp=%s, networkIp=%s, cidr=%s", function (remoteIp, networkIp, cidr, expectedError) {
|
|
53
|
+
expect(function () {
|
|
54
|
+
return (0, _isInRange.isInRange)(remoteIp, networkIp, cidr);
|
|
55
|
+
}).toThrow(expectedError);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe("invalid IP formats", function () {
|
|
59
|
+
test.each([["invalid", "192.168.1.0", 24], ["192.168.1.1", "invalid", 24], ["256.256.256.256", "192.168.1.0", 24], ["192.168.1.1", "256.256.256.256", 24], ["192.168.1.1.1", "192.168.1.0", 24], ["192.168.-1.1", "192.168.1.0", 24], ["192.168.1", "192.168.1.0", 24]])("should throw for invalid IP format: %s", function (remoteIp, networkIp, cidr) {
|
|
60
|
+
expect(function () {
|
|
61
|
+
return (0, _isInRange.isInRange)(remoteIp, networkIp, cidr);
|
|
62
|
+
}).toThrow("Invalid IP address format");
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
describe("error message formatting", function () {
|
|
66
|
+
test("should format error messages correctly with String(error) for invalid IP", function () {
|
|
67
|
+
expect(function () {
|
|
68
|
+
return (0, _isInRange.isInRange)("invalid-ip", "192.168.1.0", 24);
|
|
69
|
+
}).toThrow("Invalid IP address format: Error: Invalid IP address format");
|
|
70
|
+
});
|
|
71
|
+
test("should format error messages correctly for invalid network IP", function () {
|
|
72
|
+
expect(function () {
|
|
73
|
+
return (0, _isInRange.isInRange)("192.168.1.1", "invalid-network", 24);
|
|
74
|
+
}).toThrow("Invalid IP address format: Error: Invalid IP address format");
|
|
75
|
+
});
|
|
76
|
+
test("should format error messages for out-of-range IP values", function () {
|
|
77
|
+
expect(function () {
|
|
78
|
+
return (0, _isInRange.isInRange)("999.999.999.999", "192.168.1.0", 24);
|
|
79
|
+
}).toThrow("Invalid IP address format: Error: Invalid IP address format");
|
|
80
|
+
});
|
|
10
81
|
});
|
|
11
82
|
});
|