umt 2.3.0 → 2.4.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/Array/chunk.js +5 -3
- package/module/Array/chunk.js.map +1 -1
- package/module/Array/dualPivotQuickSort.d.ts +1 -2
- package/module/Array/dualPivotQuickSort.js +5 -26
- package/module/Array/dualPivotQuickSort.js.map +1 -1
- package/module/Array/quickSort.js +7 -25
- package/module/Array/quickSort.js.map +1 -1
- package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.d.ts +13 -0
- package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.js +20 -0
- package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.js.map +1 -0
- package/module/Array/sortingHelpers/rangeValidator.d.ts +17 -0
- package/module/Array/sortingHelpers/rangeValidator.js +26 -0
- package/module/Array/sortingHelpers/rangeValidator.js.map +1 -0
- package/module/Validate/object/core.d.ts +2 -6
- package/module/Validate/object/core.js.map +1 -1
- package/module/Validate/type.d.ts +1 -0
- package/module/es5/Array/chunk.js +5 -3
- package/module/es5/Array/dualPivotQuickSort.d.ts +1 -2
- package/module/es5/Array/dualPivotQuickSort.js +8 -28
- package/module/es5/Array/quickSort.js +10 -25
- package/module/es5/Array/sortingHelpers/applyInsertionSortIfNeeded.d.ts +13 -0
- package/module/es5/Array/sortingHelpers/applyInsertionSortIfNeeded.js +25 -0
- package/module/es5/Array/sortingHelpers/rangeValidator.d.ts +17 -0
- package/module/es5/Array/sortingHelpers/rangeValidator.js +35 -0
- package/module/es5/Validate/object/core.d.ts +2 -6
- package/module/es5/Validate/type.d.ts +1 -0
- package/module/es5/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -17
- package/module/es5/tests/integration/Array/drop-and-first.test.d.ts +0 -1
- package/module/es5/tests/integration/Array/drop-and-first.test.js +0 -34
- package/module/es5/tests/integration/Tool/parseJson-and-Validate.test.d.ts +0 -1
- package/module/es5/tests/integration/Tool/parseJson-and-Validate.test.js +0 -80
- package/module/es5/tests/unit/Advance/rangeAdvance.test.d.ts +0 -1
- package/module/es5/tests/unit/Advance/rangeAdvance.test.js +0 -26
- package/module/es5/tests/unit/Array/arraysJoin.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/arraysJoin.test.js +0 -19
- package/module/es5/tests/unit/Array/binarySearch.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/binarySearch.test.js +0 -32
- package/module/es5/tests/unit/Array/checkFlagAlignment.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/checkFlagAlignment.test.js +0 -206
- package/module/es5/tests/unit/Array/chunk.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/chunk.test.js +0 -51
- package/module/es5/tests/unit/Array/compact.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/compact.test.js +0 -53
- package/module/es5/tests/unit/Array/compareFunctionDefault.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/compareFunctionDefault.test.js +0 -29
- package/module/es5/tests/unit/Array/drop.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/drop.test.js +0 -84
- package/module/es5/tests/unit/Array/dualPivotQuickSort.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/dualPivotQuickSort.test.js +0 -87
- package/module/es5/tests/unit/Array/first.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/first.test.js +0 -28
- package/module/es5/tests/unit/Array/generateNumberArray.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/generateNumberArray.test.js +0 -34
- package/module/es5/tests/unit/Array/getArraysCommon.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/getArraysCommon.test.js +0 -40
- package/module/es5/tests/unit/Array/getArraysDiff.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/getArraysDiff.test.js +0 -99
- package/module/es5/tests/unit/Array/groupBy.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/groupBy.test.js +0 -87
- package/module/es5/tests/unit/Array/insertionSort.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/insertionSort.test.js +0 -37
- package/module/es5/tests/unit/Array/mergeSort.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/mergeSort.test.js +0 -49
- package/module/es5/tests/unit/Array/pop.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/pop.test.js +0 -50
- package/module/es5/tests/unit/Array/quickSort.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/quickSort.test.js +0 -118
- package/module/es5/tests/unit/Array/randomSelect.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/randomSelect.test.js +0 -51
- package/module/es5/tests/unit/Array/range.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/range.test.js +0 -42
- package/module/es5/tests/unit/Array/shuffle.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/shuffle.test.js +0 -84
- package/module/es5/tests/unit/Array/shuffle2DArray.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/shuffle2DArray.test.js +0 -90
- package/module/es5/tests/unit/Array/sum.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/sum.test.js +0 -44
- package/module/es5/tests/unit/Array/timSort.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/timSort.test.js +0 -128
- package/module/es5/tests/unit/Array/zip.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/zip.test.js +0 -69
- package/module/es5/tests/unit/Array/zipLongest.test.d.ts +0 -1
- package/module/es5/tests/unit/Array/zipLongest.test.js +0 -74
- package/module/es5/tests/unit/Color/cmykToRgba.test.d.ts +0 -1
- package/module/es5/tests/unit/Color/cmykToRgba.test.js +0 -58
- package/module/es5/tests/unit/Color/hexaToRgba.test.d.ts +0 -1
- package/module/es5/tests/unit/Color/hexaToRgba.test.js +0 -115
- package/module/es5/tests/unit/Color/hslaToRgba.test.d.ts +0 -1
- package/module/es5/tests/unit/Color/hslaToRgba.test.js +0 -141
- package/module/es5/tests/unit/Color/rgbaToCmyk.test.d.ts +0 -1
- package/module/es5/tests/unit/Color/rgbaToCmyk.test.js +0 -139
- package/module/es5/tests/unit/Color/rgbaToHexA.test.d.ts +0 -1
- package/module/es5/tests/unit/Color/rgbaToHexA.test.js +0 -114
- package/module/es5/tests/unit/Color/rgbaToHsla.test.d.ts +0 -1
- package/module/es5/tests/unit/Color/rgbaToHsla.test.js +0 -190
- package/module/es5/tests/unit/Consts/clock.test.d.ts +0 -1
- package/module/es5/tests/unit/Consts/clock.test.js +0 -71
- package/module/es5/tests/unit/Consts/httpClientErrorStatus.test.d.ts +0 -1
- package/module/es5/tests/unit/Consts/httpClientErrorStatus.test.js +0 -33
- package/module/es5/tests/unit/Consts/httpInformationalStatus.test.d.ts +0 -1
- package/module/es5/tests/unit/Consts/httpInformationalStatus.test.js +0 -13
- package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.d.ts +0 -1
- package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.js +0 -16
- package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.d.ts +0 -1
- package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.js +0 -15
- package/module/es5/tests/unit/Consts/httpStatus.test.d.ts +0 -1
- package/module/es5/tests/unit/Consts/httpStatus.test.js +0 -82
- package/module/es5/tests/unit/Consts/httpSuccessStatus.test.d.ts +0 -1
- package/module/es5/tests/unit/Consts/httpSuccessStatus.test.js +0 -16
- package/module/es5/tests/unit/Date/birthday.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/birthday.test.js +0 -31
- package/module/es5/tests/unit/Date/dateRange.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/dateRange.test.js +0 -40
- package/module/es5/tests/unit/Date/dayOfWeek.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/dayOfWeek.test.js +0 -39
- package/module/es5/tests/unit/Date/deleteSpace.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/deleteSpace.test.js +0 -35
- package/module/es5/tests/unit/Date/format.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/format.test.js +0 -50
- package/module/es5/tests/unit/Date/getDay.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/getDay.test.js +0 -40
- package/module/es5/tests/unit/Date/getTimezoneOffsetString.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/getTimezoneOffsetString.test.js +0 -26
- package/module/es5/tests/unit/Date/isLeapYear.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/isLeapYear.test.js +0 -30
- package/module/es5/tests/unit/Date/new.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/new.test.js +0 -39
- package/module/es5/tests/unit/Date/now.test.d.ts +0 -1
- package/module/es5/tests/unit/Date/now.test.js +0 -42
- package/module/es5/tests/unit/Error/safeExecute.test.d.ts +0 -1
- package/module/es5/tests/unit/Error/safeExecute.test.js +0 -75
- package/module/es5/tests/unit/Function/curry.test.d.ts +0 -1
- package/module/es5/tests/unit/Function/curry.test.js +0 -138
- package/module/es5/tests/unit/IP/cidrToLong.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/cidrToLong.test.js +0 -32
- package/module/es5/tests/unit/IP/cidrToSubnetMask.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/cidrToSubnetMask.test.js +0 -36
- package/module/es5/tests/unit/IP/getIpClass.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/getIpClass.test.js +0 -36
- package/module/es5/tests/unit/IP/getNetworkAddress.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/getNetworkAddress.test.js +0 -40
- package/module/es5/tests/unit/IP/ipToBinaryString.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/ipToBinaryString.test.js +0 -46
- package/module/es5/tests/unit/IP/ipToLong.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/ipToLong.test.js +0 -34
- package/module/es5/tests/unit/IP/isInRange.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/isInRange.test.js +0 -82
- package/module/es5/tests/unit/IP/isPrivateIp.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/isPrivateIp.test.js +0 -26
- package/module/es5/tests/unit/IP/longToIp.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/longToIp.test.js +0 -39
- package/module/es5/tests/unit/IP/subnetMaskToCidr.test.d.ts +0 -1
- package/module/es5/tests/unit/IP/subnetMaskToCidr.test.js +0 -41
- package/module/es5/tests/unit/Math/addition.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/addition.test.js +0 -79
- package/module/es5/tests/unit/Math/average.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/average.test.js +0 -48
- package/module/es5/tests/unit/Math/bitwise.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/bitwise.test.js +0 -62
- package/module/es5/tests/unit/Math/calculator/calculator.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/calculator/calculator.test.js +0 -76
- package/module/es5/tests/unit/Math/calculator/calculatorInitialization.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/calculator/calculatorInitialization.test.js +0 -21
- package/module/es5/tests/unit/Math/calculator/convertCurrency.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/calculator/convertCurrency.test.js +0 -40
- package/module/es5/tests/unit/Math/calculator/literalExpression.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/calculator/literalExpression.test.js +0 -51
- package/module/es5/tests/unit/Math/degToRad.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/degToRad.test.js +0 -50
- package/module/es5/tests/unit/Math/deviationValue.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/deviationValue.test.js +0 -30
- package/module/es5/tests/unit/Math/division.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/division.test.js +0 -81
- package/module/es5/tests/unit/Math/factorial.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/factorial.test.js +0 -26
- package/module/es5/tests/unit/Math/factorize.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/factorize.test.js +0 -38
- package/module/es5/tests/unit/Math/flexibleNumberConversion.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/flexibleNumberConversion.test.js +0 -195
- package/module/es5/tests/unit/Math/gcd.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/gcd.test.js +0 -35
- package/module/es5/tests/unit/Math/getDecimalLength.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/getDecimalLength.test.js +0 -44
- package/module/es5/tests/unit/Math/lcm.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/lcm.test.js +0 -43
- package/module/es5/tests/unit/Math/linearCongruentialGenerator.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/linearCongruentialGenerator.test.js +0 -25
- package/module/es5/tests/unit/Math/mathConverter.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/mathConverter.test.js +0 -37
- package/module/es5/tests/unit/Math/mathSeparator.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/mathSeparator.test.js +0 -59
- package/module/es5/tests/unit/Math/max.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/max.test.js +0 -22
- package/module/es5/tests/unit/Math/median.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/median.test.js +0 -17
- package/module/es5/tests/unit/Math/min.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/min.test.js +0 -22
- package/module/es5/tests/unit/Math/multiples.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/multiples.test.js +0 -30
- package/module/es5/tests/unit/Math/multiplication.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/multiplication.test.js +0 -48
- package/module/es5/tests/unit/Math/nCr.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/nCr.test.js +0 -34
- package/module/es5/tests/unit/Math/nHr.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/nHr.test.js +0 -35
- package/module/es5/tests/unit/Math/nPr.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/nPr.test.js +0 -38
- package/module/es5/tests/unit/Math/primeFactorization.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/primeFactorization.test.js +0 -84
- package/module/es5/tests/unit/Math/quotient.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/quotient.test.js +0 -36
- package/module/es5/tests/unit/Math/radToDeg.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/radToDeg.test.js +0 -50
- package/module/es5/tests/unit/Math/random.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/random.test.js +0 -61
- package/module/es5/tests/unit/Math/reduce.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/reduce.test.js +0 -93
- package/module/es5/tests/unit/Math/repeatedTrial.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/repeatedTrial.test.js +0 -39
- package/module/es5/tests/unit/Math/roundOf.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/roundOf.test.js +0 -40
- package/module/es5/tests/unit/Math/solveEquation.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/solveEquation.test.js +0 -24
- package/module/es5/tests/unit/Math/standardDeviation.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/standardDeviation.test.js +0 -23
- package/module/es5/tests/unit/Math/subtract.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/subtract.test.js +0 -46
- package/module/es5/tests/unit/Math/toBaseN.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/toBaseN.test.js +0 -40
- package/module/es5/tests/unit/Math/toCelsius.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/toCelsius.test.js +0 -18
- package/module/es5/tests/unit/Math/toKelvin.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/toKelvin.test.js +0 -18
- package/module/es5/tests/unit/Math/uuidv7.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/uuidv7.test.js +0 -33
- package/module/es5/tests/unit/Math/valueSwap.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/valueSwap.test.js +0 -28
- package/module/es5/tests/unit/Math/xoshiro256.test.d.ts +0 -1
- package/module/es5/tests/unit/Math/xoshiro256.test.js +0 -33
- package/module/es5/tests/unit/Object/has.test.d.ts +0 -1
- package/module/es5/tests/unit/Object/has.test.js +0 -60
- package/module/es5/tests/unit/Object/keyBy.test.d.ts +0 -1
- package/module/es5/tests/unit/Object/keyBy.test.js +0 -120
- package/module/es5/tests/unit/Object/pick.test.d.ts +0 -1
- package/module/es5/tests/unit/Object/pick.test.js +0 -109
- package/module/es5/tests/unit/Object/pickDeep.test.d.ts +0 -1
- package/module/es5/tests/unit/Object/pickDeep.test.js +0 -222
- package/module/es5/tests/unit/Simple/Array/quickSortSimple.test.d.ts +0 -1
- package/module/es5/tests/unit/Simple/Array/quickSortSimple.test.js +0 -18
- package/module/es5/tests/unit/Simple/Date/dayOfWeekSimple.test.d.ts +0 -1
- package/module/es5/tests/unit/Simple/Date/dayOfWeekSimple.test.js +0 -58
- package/module/es5/tests/unit/Simple/Math/deviationValueSimple.test.d.ts +0 -1
- package/module/es5/tests/unit/Simple/Math/deviationValueSimple.test.js +0 -43
- package/module/es5/tests/unit/String/deleteSpaces.test.d.ts +0 -1
- package/module/es5/tests/unit/String/deleteSpaces.test.js +0 -22
- package/module/es5/tests/unit/String/formatString.test.d.ts +0 -1
- package/module/es5/tests/unit/String/formatString.test.js +0 -47
- package/module/es5/tests/unit/String/fromBase64.test.d.ts +0 -1
- package/module/es5/tests/unit/String/fromBase64.test.js +0 -37
- package/module/es5/tests/unit/String/hasNoLetters.test.d.ts +0 -1
- package/module/es5/tests/unit/String/hasNoLetters.test.js +0 -29
- package/module/es5/tests/unit/String/padEnd.test.d.ts +0 -1
- package/module/es5/tests/unit/String/padEnd.test.js +0 -22
- package/module/es5/tests/unit/String/padStart.test.d.ts +0 -1
- package/module/es5/tests/unit/String/padStart.test.js +0 -40
- package/module/es5/tests/unit/String/randomString.test.d.ts +0 -1
- package/module/es5/tests/unit/String/randomString.test.js +0 -21
- package/module/es5/tests/unit/String/randomStringInitialization.test.d.ts +0 -1
- package/module/es5/tests/unit/String/randomStringInitialization.test.js +0 -25
- package/module/es5/tests/unit/String/reverseString.test.d.ts +0 -1
- package/module/es5/tests/unit/String/reverseString.test.js +0 -35
- package/module/es5/tests/unit/String/toBase64.test.d.ts +0 -1
- package/module/es5/tests/unit/String/toBase64.test.js +0 -20
- package/module/es5/tests/unit/String/toHalfWidth.test.d.ts +0 -1
- package/module/es5/tests/unit/String/toHalfWidth.test.js +0 -16
- package/module/es5/tests/unit/String/trimCharacters.test.d.ts +0 -1
- package/module/es5/tests/unit/String/trimCharacters.test.js +0 -17
- package/module/es5/tests/unit/String/trimEndCharacters.test.d.ts +0 -1
- package/module/es5/tests/unit/String/trimEndCharacters.test.js +0 -33
- package/module/es5/tests/unit/String/trimStartCharacters.test.d.ts +0 -1
- package/module/es5/tests/unit/String/trimStartCharacters.test.js +0 -33
- package/module/es5/tests/unit/Time/convertTime.test.d.ts +0 -1
- package/module/es5/tests/unit/Time/convertTime.test.js +0 -135
- package/module/es5/tests/unit/Time/normalizeTimeUnit.test.d.ts +0 -1
- package/module/es5/tests/unit/Time/normalizeTimeUnit.test.js +0 -29
- package/module/es5/tests/unit/Tool/createPipeline.test.d.ts +0 -1
- package/module/es5/tests/unit/Tool/createPipeline.test.js +0 -184
- package/module/es5/tests/unit/Tool/parseJson.test.d.ts +0 -1
- package/module/es5/tests/unit/Tool/parseJson.test.js +0 -46
- package/module/es5/tests/unit/Tool/pipe.test.d.ts +0 -1
- package/module/es5/tests/unit/Tool/pipe.test.js +0 -445
- package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.d.ts +0 -1
- package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.js +0 -47
- package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.d.ts +0 -1
- package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.js +0 -55
- package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.d.ts +0 -1
- package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.js +0 -57
- package/module/es5/tests/unit/UA/parseUserAgent.test.d.ts +0 -1
- package/module/es5/tests/unit/UA/parseUserAgent.test.js +0 -95
- package/module/es5/tests/unit/Unit/unitConverterInitialization.test.d.ts +0 -1
- package/module/es5/tests/unit/Unit/unitConverterInitialization.test.js +0 -40
- package/module/es5/tests/unit/Validate/array/core.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/array/core.test.js +0 -86
- package/module/es5/tests/unit/Validate/boolean/core.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/boolean/core.test.js +0 -29
- package/module/es5/tests/unit/Validate/core/core.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/core/core.test.js +0 -87
- package/module/es5/tests/unit/Validate/isArray.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/isArray.test.js +0 -36
- package/module/es5/tests/unit/Validate/isDictionaryObject.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/isDictionaryObject.test.js +0 -62
- package/module/es5/tests/unit/Validate/isDouble.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/isDouble.test.js +0 -47
- package/module/es5/tests/unit/Validate/isEqual.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/isEqual.test.js +0 -74
- package/module/es5/tests/unit/Validate/isNotEmpty.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/isNotEmpty.test.js +0 -43
- package/module/es5/tests/unit/Validate/isNumber.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/isNumber.test.js +0 -77
- package/module/es5/tests/unit/Validate/isPerfectSquare.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/isPerfectSquare.test.js +0 -27
- package/module/es5/tests/unit/Validate/isPrimeNumber.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/isPrimeNumber.test.js +0 -51
- package/module/es5/tests/unit/Validate/isValueNaN.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/isValueNaN.test.js +0 -54
- package/module/es5/tests/unit/Validate/number/core.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/number/core.test.js +0 -36
- package/module/es5/tests/unit/Validate/number/double.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/number/double.test.js +0 -23
- package/module/es5/tests/unit/Validate/number/even.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/number/even.test.js +0 -23
- package/module/es5/tests/unit/Validate/number/maxValue.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/number/maxValue.test.js +0 -20
- package/module/es5/tests/unit/Validate/number/minValue.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/number/minValue.test.js +0 -20
- package/module/es5/tests/unit/Validate/number/odd.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/number/odd.test.js +0 -23
- package/module/es5/tests/unit/Validate/number/prime.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/number/prime.test.js +0 -25
- package/module/es5/tests/unit/Validate/object/core.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/object/core.test.js +0 -79
- package/module/es5/tests/unit/Validate/string/core.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/string/core.test.js +0 -27
- package/module/es5/tests/unit/Validate/string/email.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/string/email.test.js +0 -21
- package/module/es5/tests/unit/Validate/string/length.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/string/length.test.js +0 -18
- package/module/es5/tests/unit/Validate/string/maxLength.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/string/maxLength.test.js +0 -18
- package/module/es5/tests/unit/Validate/string/minLength.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/string/minLength.test.js +0 -18
- package/module/es5/tests/unit/Validate/string/numberString.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/string/numberString.test.js +0 -22
- package/module/es5/tests/unit/Validate/string/regexMatch.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/string/regexMatch.test.js +0 -29
- package/module/es5/tests/unit/Validate/string/uuid.test.d.ts +0 -1
- package/module/es5/tests/unit/Validate/string/uuid.test.js +0 -72
- package/module/es5/tests/unit/types/arrayType.test.d.ts +0 -1
- package/module/es5/tests/unit/types/arrayType.test.js +0 -11
- package/module/es5/tests/unit/types/clockType.test.d.ts +0 -1
- package/module/es5/tests/unit/types/clockType.test.js +0 -37
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ipToBinaryString = require("@/IP/ipToBinaryString");
|
|
4
|
-
describe("ipToBinaryString", function () {
|
|
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
|
-
});
|
|
26
|
-
});
|
|
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
|
-
});
|
|
33
|
-
});
|
|
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
|
-
});
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ipToLong = require("@/IP/ipToLong");
|
|
4
|
-
describe("ipToLong", function () {
|
|
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
|
-
});
|
|
26
|
-
});
|
|
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
|
-
});
|
|
33
|
-
});
|
|
34
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _isInRange = require("@/IP/isInRange");
|
|
4
|
-
describe("isInRange", function () {
|
|
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
|
-
});
|
|
50
|
-
});
|
|
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
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _isPrivateIp = require("@/IP/isPrivateIp");
|
|
4
|
-
describe("isPrivateIp", function () {
|
|
5
|
-
describe("private IP addresses", function () {
|
|
6
|
-
test.each([
|
|
7
|
-
// [IP address, description]
|
|
8
|
-
["10.0.0.1", "Class A private - start range"], ["10.255.255.255", "Class A private - end range"], ["172.16.0.1", "Class B private - start range"], ["172.31.255.255", "Class B private - end range"], ["192.168.0.1", "Class C private - start range"], ["192.168.255.255", "Class C private - end range"]])("should identify %s as private IP (%s)", function (ip) {
|
|
9
|
-
expect((0, _isPrivateIp.isPrivateIp)(ip)).toBe(true);
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
describe("non-private IP addresses", function () {
|
|
13
|
-
test.each([
|
|
14
|
-
// [IP address, description]
|
|
15
|
-
["9.255.255.255", "Just before Class A private"], ["11.0.0.0", "Just after Class A private"], ["172.15.255.255", "Just before Class B private"], ["172.32.0.0", "Just after Class B private"], ["192.167.255.255", "Just before Class C private"], ["192.169.0.0", "Just after Class C private"], ["8.8.8.8", "Google DNS"], ["1.1.1.1", "Cloudflare DNS"], ["169.254.0.1", "Link-local address"], ["127.0.0.1", "Localhost"]])("should identify %s as non-private IP (%s)", function (ip) {
|
|
16
|
-
expect((0, _isPrivateIp.isPrivateIp)(ip)).toBe(false);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
describe("invalid inputs", function () {
|
|
20
|
-
test.each([[undefined, "IP address is required"], ["", "IP address is required"], ["256.256.256.256", "Invalid IP address"], ["192.168", "Invalid IP address"], ["a.b.c.d", "Invalid IP address"], ["192.168.1.1.1", "Invalid IP address"], ["-1.0.0.0", "Invalid IP address"]])("should throw error for %s: %s", function (ip, expectedError) {
|
|
21
|
-
expect(function () {
|
|
22
|
-
return (0, _isPrivateIp.isPrivateIp)(ip);
|
|
23
|
-
}).toThrow(expectedError);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _longToIp = require("@/IP/longToIp");
|
|
4
|
-
describe("longToIp", function () {
|
|
5
|
-
describe("valid 32-bit integers", function () {
|
|
6
|
-
test.each([
|
|
7
|
-
// [long value, expected IP]
|
|
8
|
-
[0xc0a80001, "192.168.0.1"],
|
|
9
|
-
// Common private network
|
|
10
|
-
[0x80000001, "128.0.0.1"],
|
|
11
|
-
// Class B start
|
|
12
|
-
[0x0a000001, "10.0.0.1"],
|
|
13
|
-
// Class A private
|
|
14
|
-
[0xac100001, "172.16.0.1"],
|
|
15
|
-
// Class B private
|
|
16
|
-
[0xffffffff, "255.255.255.255"],
|
|
17
|
-
// Maximum value
|
|
18
|
-
[0x00000000, "0.0.0.0"],
|
|
19
|
-
// Minimum value
|
|
20
|
-
[0x7f000001, "127.0.0.1"],
|
|
21
|
-
// Localhost
|
|
22
|
-
[0x01020304, "1.2.3.4"] // Simple incremental
|
|
23
|
-
])("should convert %i to %s", function (_long, expected) {
|
|
24
|
-
expect((0, _longToIp.longToIp)(_long)).toBe(expected);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
describe("invalid inputs", function () {
|
|
28
|
-
test.each([[undefined, "Input must be a valid 32-bit unsigned integer"], [null, "Input must be a valid 32-bit unsigned integer"], [Number.NaN, "Input must be a valid 32-bit unsigned integer"], [Number.POSITIVE_INFINITY, "Input must be a valid 32-bit unsigned integer"], [-1, "Input must be a valid 32-bit unsigned integer"], [0x100000000, "Input must be a valid 32-bit unsigned integer"],
|
|
29
|
-
// Too large
|
|
30
|
-
[1.5, "Input must be a valid 32-bit unsigned integer"],
|
|
31
|
-
// Not an integer
|
|
32
|
-
["123", "Input must be a valid 32-bit unsigned integer"] // Wrong type
|
|
33
|
-
])("should throw error for %p: %s", function (input, expectedError) {
|
|
34
|
-
expect(function () {
|
|
35
|
-
return (0, _longToIp.longToIp)(input);
|
|
36
|
-
}).toThrow(expectedError);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _subnetMaskToCidr = require("@/IP/subnetMaskToCidr");
|
|
4
|
-
describe("subnetMaskToCidr", function () {
|
|
5
|
-
describe("valid subnet masks", function () {
|
|
6
|
-
test.each([
|
|
7
|
-
// [subnet mask, expected CIDR]
|
|
8
|
-
["255.255.255.255", 32],
|
|
9
|
-
// All bits set
|
|
10
|
-
["255.255.255.0", 24],
|
|
11
|
-
// Common /24 network
|
|
12
|
-
["255.255.0.0", 16],
|
|
13
|
-
// Common /16 network
|
|
14
|
-
["255.0.0.0", 8],
|
|
15
|
-
// Common /8 network
|
|
16
|
-
["255.255.254.0", 23],
|
|
17
|
-
// Less common /23 network
|
|
18
|
-
["255.255.255.252", 30],
|
|
19
|
-
// Small /30 network
|
|
20
|
-
["255.255.255.248", 29],
|
|
21
|
-
// Small /29 network
|
|
22
|
-
["255.255.240.0", 20],
|
|
23
|
-
// Medium /20 network
|
|
24
|
-
["0.0.0.0", 0] // No bits set
|
|
25
|
-
])("should convert %s to /%i", function (mask, expected) {
|
|
26
|
-
expect((0, _subnetMaskToCidr.subnetMaskToCidr)(mask)).toBe(expected);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
describe("invalid subnet masks", function () {
|
|
30
|
-
test.each([[undefined, "Subnet mask is required"], ["", "Subnet mask is required"], ["192.168", "Invalid subnet mask format"], ["256.255.255.0", "Invalid subnet mask format"], ["255.255.255.256", "Invalid subnet mask format"], ["255.-1.255.0", "Invalid subnet mask format"], ["255.255.255.abc", "Invalid subnet mask format"], ["a.b.c.d", "Invalid subnet mask format"], ["255.255.255.1", "Invalid subnet mask: must be consecutive 1s followed by 0s"],
|
|
31
|
-
// Non-continuous mask
|
|
32
|
-
["255.0.255.0", "Invalid subnet mask: must be consecutive 1s followed by 0s"],
|
|
33
|
-
// Non-continuous mask
|
|
34
|
-
["254.255.255.0", "Invalid subnet mask: must be consecutive 1s followed by 0s"] // Invalid bit pattern
|
|
35
|
-
])("should throw error for %s: %s", function (mask, expectedError) {
|
|
36
|
-
expect(function () {
|
|
37
|
-
return (0, _subnetMaskToCidr.subnetMaskToCidr)(mask);
|
|
38
|
-
}).toThrow(expectedError);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _addition = require("@/Math/addition");
|
|
4
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
5
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
8
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
9
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
-
describe("addition", function () {
|
|
11
|
-
var testCases = [{
|
|
12
|
-
args: [2, 3],
|
|
13
|
-
expected: 5
|
|
14
|
-
}, {
|
|
15
|
-
args: [-2, -3],
|
|
16
|
-
expected: -5
|
|
17
|
-
}, {
|
|
18
|
-
args: [2, -3],
|
|
19
|
-
expected: -1
|
|
20
|
-
}, {
|
|
21
|
-
args: [0.1, 0.2],
|
|
22
|
-
expected: 0.3,
|
|
23
|
-
closeTo: true
|
|
24
|
-
}, {
|
|
25
|
-
args: [-0.1, -0.2],
|
|
26
|
-
expected: -0.3,
|
|
27
|
-
closeTo: true
|
|
28
|
-
}, {
|
|
29
|
-
args: [0.1, -0.2],
|
|
30
|
-
expected: -0.1,
|
|
31
|
-
closeTo: true
|
|
32
|
-
}, {
|
|
33
|
-
args: [2, 0.3],
|
|
34
|
-
expected: 2.3,
|
|
35
|
-
closeTo: true
|
|
36
|
-
}, {
|
|
37
|
-
args: [-2, -0.3],
|
|
38
|
-
expected: -2.3,
|
|
39
|
-
closeTo: true
|
|
40
|
-
}, {
|
|
41
|
-
args: [2, -0.3],
|
|
42
|
-
expected: 1.7,
|
|
43
|
-
closeTo: true
|
|
44
|
-
}, {
|
|
45
|
-
args: [-2, 0.3],
|
|
46
|
-
expected: -1.7,
|
|
47
|
-
closeTo: true
|
|
48
|
-
}, {
|
|
49
|
-
args: [1, 2, 3],
|
|
50
|
-
expected: 6
|
|
51
|
-
}, {
|
|
52
|
-
args: [-1, -2, -3],
|
|
53
|
-
expected: -6
|
|
54
|
-
}, {
|
|
55
|
-
args: [0.1, 0.2, 0.3],
|
|
56
|
-
expected: 0.6,
|
|
57
|
-
closeTo: true
|
|
58
|
-
}, {
|
|
59
|
-
args: [2, -3, 1],
|
|
60
|
-
expected: 0
|
|
61
|
-
}, {
|
|
62
|
-
args: [-2, 0.5, 1.5],
|
|
63
|
-
expected: 0,
|
|
64
|
-
closeTo: true
|
|
65
|
-
}];
|
|
66
|
-
testCases.forEach(function (_ref) {
|
|
67
|
-
var args = _ref.args,
|
|
68
|
-
expected = _ref.expected,
|
|
69
|
-
closeTo = _ref.closeTo;
|
|
70
|
-
it("should add ".concat(args.length, " numbers: ").concat(args.join(", ")), function () {
|
|
71
|
-
var result = _addition.addition.apply(void 0, _toConsumableArray(args));
|
|
72
|
-
if (closeTo) {
|
|
73
|
-
expect(result).toBeCloseTo(expected);
|
|
74
|
-
} else {
|
|
75
|
-
expect(result).toBe(expected);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _average = require("@/Math/average");
|
|
4
|
-
describe("average function", function () {
|
|
5
|
-
describe("basic scenarios", function () {
|
|
6
|
-
it("should calculate average of integer numbers", function () {
|
|
7
|
-
expect((0, _average.average)([1, 2])).toBe(1.5);
|
|
8
|
-
expect((0, _average.average)([1, 2, 3, 4, 5])).toBe(3);
|
|
9
|
-
});
|
|
10
|
-
it("should calculate average of decimal numbers", function () {
|
|
11
|
-
expect((0, _average.average)([1.1, 2.2])).toBeCloseTo(1.65);
|
|
12
|
-
expect((0, _average.average)([1.1, 2.2, 3.3, 4.4, 5.5])).toBeCloseTo(3.3);
|
|
13
|
-
});
|
|
14
|
-
it("should handle single element arrays", function () {
|
|
15
|
-
expect((0, _average.average)([5])).toBe(5);
|
|
16
|
-
expect((0, _average.average)([3.14])).toBe(3.14);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
describe("special cases", function () {
|
|
20
|
-
it("should handle arrays with zeros", function () {
|
|
21
|
-
expect((0, _average.average)([0, 0, 0])).toBe(0);
|
|
22
|
-
expect((0, _average.average)([1, 0, 2, 0, 3])).toBe(1.2);
|
|
23
|
-
});
|
|
24
|
-
it("should handle negative numbers", function () {
|
|
25
|
-
expect((0, _average.average)([-1, -2])).toBe(-1.5);
|
|
26
|
-
expect((0, _average.average)([-10, -20, -30])).toBe(-20);
|
|
27
|
-
});
|
|
28
|
-
it("should handle mixed positive and negative numbers", function () {
|
|
29
|
-
expect((0, _average.average)([-1, 1])).toBe(0);
|
|
30
|
-
expect((0, _average.average)([-10, 10, -5, 5])).toBe(0);
|
|
31
|
-
});
|
|
32
|
-
it("should return 0 for empty arrays", function () {
|
|
33
|
-
expect((0, _average.average)([])).toBe(0);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
describe("edge cases", function () {
|
|
37
|
-
it("should handle large numbers", function () {
|
|
38
|
-
expect((0, _average.average)([Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER])).toBe(Number.MAX_SAFE_INTEGER);
|
|
39
|
-
});
|
|
40
|
-
it("should handle small numbers", function () {
|
|
41
|
-
expect((0, _average.average)([Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER])).toBe(Number.MIN_SAFE_INTEGER);
|
|
42
|
-
});
|
|
43
|
-
it("should handle large arrays", function () {
|
|
44
|
-
var largeArray = new Array(10000).fill(1);
|
|
45
|
-
expect((0, _average.average)(largeArray)).toBe(1);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _bitwise = require("@/Math/bitwise");
|
|
4
|
-
describe("bitwise", function () {
|
|
5
|
-
it("should rotate 8 bits to the left", function () {
|
|
6
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 8);
|
|
7
|
-
expect(result.toString(16)).toBe("34567812");
|
|
8
|
-
});
|
|
9
|
-
it("should rotate 16 bits to the left", function () {
|
|
10
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 16);
|
|
11
|
-
expect(result.toString(16)).toBe("56781234");
|
|
12
|
-
});
|
|
13
|
-
it("should rotate 24 bits to the left", function () {
|
|
14
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 24);
|
|
15
|
-
expect(result.toString(16)).toBe("78123456");
|
|
16
|
-
});
|
|
17
|
-
it("should rotate 32 bits to the left (same as original value)", function () {
|
|
18
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 32);
|
|
19
|
-
expect(result.toString(16)).toBe("12345678");
|
|
20
|
-
});
|
|
21
|
-
it("should rotate 0 bits to the left (same as original value)", function () {
|
|
22
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 0);
|
|
23
|
-
expect(result.toString(16)).toBe("12345678");
|
|
24
|
-
});
|
|
25
|
-
it("should handle negative bit count (same as right rotation)", function () {
|
|
26
|
-
var result = (0, _bitwise.bitwise)(0x12345678, -8);
|
|
27
|
-
expect(result.toString(16)).toBe("78123456");
|
|
28
|
-
});
|
|
29
|
-
it("should handle bit count over 32 (rotate by remainder when divided by 32)", function () {
|
|
30
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 40); // 40 % 32 = 8
|
|
31
|
-
expect(result.toString(16)).toBe("34567812");
|
|
32
|
-
});
|
|
33
|
-
it("should rotate 8 bits to the right", function () {
|
|
34
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 8, "right");
|
|
35
|
-
expect(result.toString(16)).toBe("78123456");
|
|
36
|
-
});
|
|
37
|
-
it("should rotate 16 bits to the right", function () {
|
|
38
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 16, "right");
|
|
39
|
-
expect(result.toString(16)).toBe("56781234");
|
|
40
|
-
});
|
|
41
|
-
it("should rotate 24 bits to the right", function () {
|
|
42
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 24, "right");
|
|
43
|
-
expect(result.toString(16)).toBe("34567812");
|
|
44
|
-
});
|
|
45
|
-
it("should rotate 32 bits to the right (same as original value)", function () {
|
|
46
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 32, "right");
|
|
47
|
-
expect(result.toString(16)).toBe("12345678");
|
|
48
|
-
});
|
|
49
|
-
it("should rotate 0 bits to the right (same as original value)", function () {
|
|
50
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 0, "right");
|
|
51
|
-
expect(result.toString(16)).toBe("12345678");
|
|
52
|
-
});
|
|
53
|
-
it("should handle bit count over 32 (rotate by remainder when divided by 32)", function () {
|
|
54
|
-
var result = (0, _bitwise.bitwise)(0x12345678, 40, "right"); // 40 % 32 = 8
|
|
55
|
-
expect(result.toString(16)).toBe("78123456");
|
|
56
|
-
});
|
|
57
|
-
it("should throw error for invalid direction", function () {
|
|
58
|
-
expect(function () {
|
|
59
|
-
return (0, _bitwise.bitwise)(0x12345678, 8, "invalid");
|
|
60
|
-
}).toThrowError("Invalid direction");
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _calculator = require("@/Math/calculator");
|
|
4
|
-
describe("calculator function", function () {
|
|
5
|
-
// Addition
|
|
6
|
-
test("should handle addition", function () {
|
|
7
|
-
expect((0, _calculator.calculator)("1+")).toBe("1+");
|
|
8
|
-
expect((0, _calculator.calculator)("1+1")).toBe("2");
|
|
9
|
-
expect((0, _calculator.calculator)("1+1+1")).toBe("3");
|
|
10
|
-
expect((0, _calculator.calculator)("1+1+1+1")).toBe("4");
|
|
11
|
-
expect((0, _calculator.calculator)("1+1+1+1+1")).toBe("5");
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// Subtraction
|
|
15
|
-
test("should handle subtraction", function () {
|
|
16
|
-
expect((0, _calculator.calculator)("1-")).toBe("1-");
|
|
17
|
-
expect((0, _calculator.calculator)("1-1")).toBe("0");
|
|
18
|
-
expect((0, _calculator.calculator)("1-1-1")).toBe("-1");
|
|
19
|
-
expect((0, _calculator.calculator)("1-1-1-1")).toBe("-2");
|
|
20
|
-
expect((0, _calculator.calculator)("1-1-1-1-1")).toBe("-3");
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// Multiplication
|
|
24
|
-
test("should handle multiplication", function () {
|
|
25
|
-
expect((0, _calculator.calculator)("2*")).toBe("2*");
|
|
26
|
-
expect((0, _calculator.calculator)("2*2")).toBe("4");
|
|
27
|
-
expect((0, _calculator.calculator)("2*2*2")).toBe("8");
|
|
28
|
-
expect((0, _calculator.calculator)("2*2*2*2")).toBe("16");
|
|
29
|
-
expect((0, _calculator.calculator)("2*2*2*2*2")).toBe("32");
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// Division
|
|
33
|
-
test("should handle division", function () {
|
|
34
|
-
expect((0, _calculator.calculator)("2/")).toBe("2/");
|
|
35
|
-
expect((0, _calculator.calculator)("2/2")).toBe("1");
|
|
36
|
-
expect((0, _calculator.calculator)("2/2/2")).toBe("0.5");
|
|
37
|
-
expect((0, _calculator.calculator)("2/2/2/2")).toBe("0.25");
|
|
38
|
-
expect((0, _calculator.calculator)("2/2/2/2/2")).toBe("0.125");
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// Exponentiation
|
|
42
|
-
test("should handle exponentiation", function () {
|
|
43
|
-
expect((0, _calculator.calculator)("2^")).toBe("2^");
|
|
44
|
-
expect((0, _calculator.calculator)("2^2")).toBe("4");
|
|
45
|
-
expect((0, _calculator.calculator)("2^2^2")).toBe("16");
|
|
46
|
-
expect((0, _calculator.calculator)("2^2^2^2")).toBe("65536");
|
|
47
|
-
expect((0, _calculator.calculator)("2^2^2^2^2")).toBe("Infinity");
|
|
48
|
-
expect((0, _calculator.calculator)("3^4")).toBe("81");
|
|
49
|
-
expect((0, _calculator.calculator)("3^4^2")).toBe("43046721");
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// Parentheses
|
|
53
|
-
test("should handle parentheses", function () {
|
|
54
|
-
expect((0, _calculator.calculator)("(1+1)")).toBe("2");
|
|
55
|
-
expect((0, _calculator.calculator)("(1")).toBe("(1");
|
|
56
|
-
expect((0, _calculator.calculator)("(1+")).toBe("(1+");
|
|
57
|
-
expect((0, _calculator.calculator)("1)")).toBe("1)");
|
|
58
|
-
expect((0, _calculator.calculator)("(1)")).toBe("(1)");
|
|
59
|
-
expect((0, _calculator.calculator)("(1+1)+(1+1)")).toBe("4");
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// Equations
|
|
63
|
-
test("should handle equations", function () {
|
|
64
|
-
expect((0, _calculator.calculator)("2x=(1+1)+(1+1)+(1+1)")).toBe("3");
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
// Variables and currency conversion
|
|
68
|
-
test("should handle variables", function () {
|
|
69
|
-
expect((0, _calculator.calculator)("$10*2", {
|
|
70
|
-
$: 100
|
|
71
|
-
})).toBe("2000");
|
|
72
|
-
expect((0, _calculator.calculator)("2*$10", {
|
|
73
|
-
$: 100
|
|
74
|
-
})).toBe("2000");
|
|
75
|
-
});
|
|
76
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _calculatorInitialization = require("@/Math/calculator/calculatorInitialization");
|
|
4
|
-
describe("calculatorInitialization function", function () {
|
|
5
|
-
it("should initialize a calculator with exchange rates", function () {
|
|
6
|
-
var calculator = (0, _calculatorInitialization.calculatorInitialization)({
|
|
7
|
-
$: 100
|
|
8
|
-
});
|
|
9
|
-
expect(calculator("$1")).toBe("100");
|
|
10
|
-
expect(calculator("100 + $1")).toBe("200");
|
|
11
|
-
});
|
|
12
|
-
it("should handle multiple exchange rates", function () {
|
|
13
|
-
var calculator = (0, _calculatorInitialization.calculatorInitialization)({
|
|
14
|
-
$: 100,
|
|
15
|
-
EUR: 120
|
|
16
|
-
});
|
|
17
|
-
expect(calculator("$1")).toBe("100");
|
|
18
|
-
expect(calculator("EUR1")).toBe("120");
|
|
19
|
-
expect(calculator("$1 + EUR1")).toBe("220");
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _convertCurrency = require("@/Math/calculator/convertCurrency");
|
|
4
|
-
/**
|
|
5
|
-
* Tests for the convertCurrency function
|
|
6
|
-
*/
|
|
7
|
-
describe("convertCurrency function", function () {
|
|
8
|
-
// Case 1: No conversion rates provided
|
|
9
|
-
test("should return original string when conversionRates is undefined", function () {
|
|
10
|
-
expect((0, _convertCurrency.convertCurrency)("¥1000")).toBe("¥1000");
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// Case 2: Currency symbol doesn't match
|
|
14
|
-
test("should return original string when currency symbol doesn't match", function () {
|
|
15
|
-
expect((0, _convertCurrency.convertCurrency)("¥1000", {
|
|
16
|
-
$: 1.1
|
|
17
|
-
})).toBe("¥1000");
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// Case 3: Currency symbol matches and conversion rate is a number
|
|
21
|
-
test("should convert currency when symbol matches and rate is a number", function () {
|
|
22
|
-
expect((0, _convertCurrency.convertCurrency)("¥1000", {
|
|
23
|
-
"¥": 1.1
|
|
24
|
-
})).toBe("1100");
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// Case 4: Currency symbol matches but conversion rate is not a number
|
|
28
|
-
test("should return original string when rate is not a number", function () {
|
|
29
|
-
expect((0, _convertCurrency.convertCurrency)("¥1000", {
|
|
30
|
-
"¥": "invalid"
|
|
31
|
-
})).toBe("¥1000");
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// Case 5: Conversion result is NaN
|
|
35
|
-
test("should return original string when conversion result is NaN", function () {
|
|
36
|
-
expect((0, _convertCurrency.convertCurrency)("¥NaN", {
|
|
37
|
-
"¥": 1.1
|
|
38
|
-
})).toBe("¥NaN");
|
|
39
|
-
});
|
|
40
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|