umt 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +277 -16
- 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/groupBy.js +8 -7
- 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/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/Array/timSort.js +2 -20
- package/module/Array/timSort.js.map +1 -1
- package/module/Array/ultraNumberSort.d.ts +7 -0
- package/module/Array/ultraNumberSort.js +373 -0
- package/module/Array/ultraNumberSort.js.map +1 -0
- package/module/Tool/pipe.d.ts +1 -1
- package/module/Tool/pipe.js.map +1 -1
- 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/groupBy.js +8 -7
- package/module/es5/Array/index.d.ts +1 -0
- package/module/es5/Array/index.js +11 -0
- 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/Array/timSort.js +2 -20
- package/module/es5/Array/ultraNumberSort.d.ts +7 -0
- package/module/es5/Array/ultraNumberSort.js +475 -0
- package/module/es5/Tool/pipe.d.ts +1 -1
- 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 +24 -20
- 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,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _reduce = require("@/Math/reduce");
|
|
4
|
-
describe("reduce function", function () {
|
|
5
|
-
describe("basic fraction reduction", function () {
|
|
6
|
-
it("should reduce simple fractions", function () {
|
|
7
|
-
expect((0, _reduce.reduce)(2, 4)).toEqual({
|
|
8
|
-
x: 1,
|
|
9
|
-
y: 2,
|
|
10
|
-
gcd: 2
|
|
11
|
-
});
|
|
12
|
-
expect((0, _reduce.reduce)(3, 6)).toEqual({
|
|
13
|
-
x: 1,
|
|
14
|
-
y: 2,
|
|
15
|
-
gcd: 3
|
|
16
|
-
});
|
|
17
|
-
expect((0, _reduce.reduce)(8, 12)).toEqual({
|
|
18
|
-
x: 2,
|
|
19
|
-
y: 3,
|
|
20
|
-
gcd: 4
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
it("should handle already reduced fractions", function () {
|
|
24
|
-
expect((0, _reduce.reduce)(3, 4)).toEqual({
|
|
25
|
-
x: 3,
|
|
26
|
-
y: 4,
|
|
27
|
-
gcd: 1
|
|
28
|
-
});
|
|
29
|
-
expect((0, _reduce.reduce)(7, 9)).toEqual({
|
|
30
|
-
x: 7,
|
|
31
|
-
y: 9,
|
|
32
|
-
gcd: 1
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
it("should handle fractions with 1", function () {
|
|
36
|
-
expect((0, _reduce.reduce)(5, 1)).toEqual({
|
|
37
|
-
x: 5,
|
|
38
|
-
y: 1,
|
|
39
|
-
gcd: 1
|
|
40
|
-
});
|
|
41
|
-
expect((0, _reduce.reduce)(1, 7)).toEqual({
|
|
42
|
-
x: 1,
|
|
43
|
-
y: 7,
|
|
44
|
-
gcd: 1
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
describe("edge cases", function () {
|
|
49
|
-
it("should handle zero in numerator or denominator", function () {
|
|
50
|
-
expect((0, _reduce.reduce)(0, 5)).toEqual({
|
|
51
|
-
x: Number.NaN,
|
|
52
|
-
y: Number.NaN
|
|
53
|
-
});
|
|
54
|
-
expect((0, _reduce.reduce)(5, 0)).toEqual({
|
|
55
|
-
x: Number.NaN,
|
|
56
|
-
y: Number.NaN
|
|
57
|
-
});
|
|
58
|
-
expect((0, _reduce.reduce)(0, 0)).toEqual({
|
|
59
|
-
x: Number.NaN,
|
|
60
|
-
y: Number.NaN
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
it("should handle negative numbers", function () {
|
|
64
|
-
expect((0, _reduce.reduce)(-6, 8)).toEqual({
|
|
65
|
-
x: -3,
|
|
66
|
-
y: 4,
|
|
67
|
-
gcd: 2
|
|
68
|
-
});
|
|
69
|
-
expect((0, _reduce.reduce)(6, -8)).toEqual({
|
|
70
|
-
x: -3,
|
|
71
|
-
y: 4,
|
|
72
|
-
gcd: 2
|
|
73
|
-
});
|
|
74
|
-
expect((0, _reduce.reduce)(-6, -8)).toEqual({
|
|
75
|
-
x: 3,
|
|
76
|
-
y: 4,
|
|
77
|
-
gcd: 2
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
it("should handle larger numbers", function () {
|
|
81
|
-
expect((0, _reduce.reduce)(1000, 2500)).toEqual({
|
|
82
|
-
x: 2,
|
|
83
|
-
y: 5,
|
|
84
|
-
gcd: 500
|
|
85
|
-
});
|
|
86
|
-
expect((0, _reduce.reduce)(24680, 12340)).toEqual({
|
|
87
|
-
x: 2,
|
|
88
|
-
y: 1,
|
|
89
|
-
gcd: 12340
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _repeatedTrial = require("@/Math/repeatedTrial");
|
|
4
|
-
describe("repeatedTrial", function () {
|
|
5
|
-
it("should calculate basic probability cases", function () {
|
|
6
|
-
expect((0, _repeatedTrial.repeatedTrial)(4, 2, {
|
|
7
|
-
x: 1,
|
|
8
|
-
y: 3
|
|
9
|
-
})).toEqual([8, 27]);
|
|
10
|
-
expect((0, _repeatedTrial.repeatedTrial)(5, 2, {
|
|
11
|
-
x: 1,
|
|
12
|
-
y: 2
|
|
13
|
-
})).toEqual([5, 16]);
|
|
14
|
-
expect((0, _repeatedTrial.repeatedTrial)(3, 2, {
|
|
15
|
-
x: 1,
|
|
16
|
-
y: 2
|
|
17
|
-
})).toEqual([3, 8]);
|
|
18
|
-
});
|
|
19
|
-
it("should handle extreme probability cases", function () {
|
|
20
|
-
expect((0, _repeatedTrial.repeatedTrial)(3, 3, {
|
|
21
|
-
x: 2,
|
|
22
|
-
y: 3
|
|
23
|
-
})).toEqual([8, 27]);
|
|
24
|
-
expect((0, _repeatedTrial.repeatedTrial)(4, 4, {
|
|
25
|
-
x: 1,
|
|
26
|
-
y: 2
|
|
27
|
-
})).toEqual([1, 16]);
|
|
28
|
-
});
|
|
29
|
-
it("should handle probability with simple fractions", function () {
|
|
30
|
-
expect((0, _repeatedTrial.repeatedTrial)(2, 1, {
|
|
31
|
-
x: 1,
|
|
32
|
-
y: 2
|
|
33
|
-
})).toEqual([1, 2]);
|
|
34
|
-
expect((0, _repeatedTrial.repeatedTrial)(3, 2, {
|
|
35
|
-
x: 1,
|
|
36
|
-
y: 3
|
|
37
|
-
})).toEqual([2, 9]);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _roundOf = require("@/Math/roundOf");
|
|
4
|
-
describe("roundOf function", function () {
|
|
5
|
-
describe("basic rounding", function () {
|
|
6
|
-
it("should round to default precision (0)", function () {
|
|
7
|
-
expect((0, _roundOf.roundOf)(1.111111111111)).toBe(1);
|
|
8
|
-
expect((0, _roundOf.roundOf)(1.555555555555)).toBe(2);
|
|
9
|
-
expect((0, _roundOf.roundOf)(1.499999999999)).toBe(1);
|
|
10
|
-
});
|
|
11
|
-
it("should round to specified decimal places", function () {
|
|
12
|
-
expect((0, _roundOf.roundOf)(1.111111111111, 2)).toBe(1.11);
|
|
13
|
-
expect((0, _roundOf.roundOf)(1.555555555555, 2)).toBe(1.56);
|
|
14
|
-
expect((0, _roundOf.roundOf)(1.499999999999, 2)).toBe(1.5);
|
|
15
|
-
});
|
|
16
|
-
it("should handle increasing precision", function () {
|
|
17
|
-
var value = 1.111111111111;
|
|
18
|
-
expect((0, _roundOf.roundOf)(value, 1)).toBe(1.1);
|
|
19
|
-
expect((0, _roundOf.roundOf)(value, 2)).toBe(1.11);
|
|
20
|
-
expect((0, _roundOf.roundOf)(value, 3)).toBe(1.111);
|
|
21
|
-
expect((0, _roundOf.roundOf)(value, 4)).toBe(1.1111);
|
|
22
|
-
expect((0, _roundOf.roundOf)(value, 5)).toBe(1.11111);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
describe("edge cases", function () {
|
|
26
|
-
it("should handle negative numbers", function () {
|
|
27
|
-
expect((0, _roundOf.roundOf)(-1.234, 2)).toBe(-1.23);
|
|
28
|
-
expect((0, _roundOf.roundOf)(-1.235, 2)).toBe(-1.24);
|
|
29
|
-
});
|
|
30
|
-
it("should handle zero with different precisions", function () {
|
|
31
|
-
expect((0, _roundOf.roundOf)(0, 0)).toBe(0);
|
|
32
|
-
expect((0, _roundOf.roundOf)(0, 2)).toBe(0);
|
|
33
|
-
expect((0, _roundOf.roundOf)(0.0, 4)).toBe(0);
|
|
34
|
-
});
|
|
35
|
-
it("should handle negative precision", function () {
|
|
36
|
-
expect((0, _roundOf.roundOf)(1234.5678, -1)).toBe(1230);
|
|
37
|
-
expect((0, _roundOf.roundOf)(1234.5678, -2)).toBe(1200);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _solveEquation = require("@/Math/solveEquation");
|
|
4
|
-
describe("solveEquation function", function () {
|
|
5
|
-
it("should solve a 2x2 system of linear equations (case 1)", function () {
|
|
6
|
-
// System:
|
|
7
|
-
// x + y = 4
|
|
8
|
-
// x + 2y = 10
|
|
9
|
-
expect((0, _solveEquation.solveEquation)([[1, 1], [1, 2]], [4, 10])).toEqual([-2, 6]);
|
|
10
|
-
});
|
|
11
|
-
it("should solve a 2x2 system of linear equations (case 2)", function () {
|
|
12
|
-
// System:
|
|
13
|
-
// x + 6y = 33
|
|
14
|
-
// x + y = 8
|
|
15
|
-
expect((0, _solveEquation.solveEquation)([[1, 6], [1, 1]], [33, 8])).toEqual([3, 5]);
|
|
16
|
-
});
|
|
17
|
-
it("should solve a 3x3 system of linear equations", function () {
|
|
18
|
-
// System:
|
|
19
|
-
// 5x - 4y + 6z = 8
|
|
20
|
-
// 7x - 6y + 10z = 14
|
|
21
|
-
// 4x + 9y + 7z = 74
|
|
22
|
-
expect((0, _solveEquation.solveEquation)([[5, -4, 6], [7, -6, 10], [4, 9, 7]], [8, 14, 74])).toEqual([2, 5, 3]);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _standardDeviation = require("@/Math/standardDeviation");
|
|
4
|
-
describe("standardDeviation function", function () {
|
|
5
|
-
it("should calculate standard deviation of sequential integers", function () {
|
|
6
|
-
expect((0, _standardDeviation.standardDeviation)([1, 2, 3, 4, 5])).toBe(1.4142135623730951);
|
|
7
|
-
expect((0, _standardDeviation.standardDeviation)([1, 2, 3])).toBe(0.816496580927726);
|
|
8
|
-
});
|
|
9
|
-
it("should calculate standard deviation of non-sequential values", function () {
|
|
10
|
-
expect((0, _standardDeviation.standardDeviation)([10, 12, 23, 23, 16, 23, 21, 16])).toBe(4.898979485566356);
|
|
11
|
-
expect((0, _standardDeviation.standardDeviation)([5, 10, 15, 20, 25])).toBe(7.0710678118654755);
|
|
12
|
-
});
|
|
13
|
-
it("should handle edge cases", function () {
|
|
14
|
-
// All same values should have standard deviation of 0
|
|
15
|
-
expect((0, _standardDeviation.standardDeviation)([5, 5, 5, 5])).toBe(0);
|
|
16
|
-
|
|
17
|
-
// Single value should have standard deviation of 0
|
|
18
|
-
expect((0, _standardDeviation.standardDeviation)([42])).toBe(0);
|
|
19
|
-
|
|
20
|
-
// Empty array should return 0 (as average function returns 0 for empty arrays)
|
|
21
|
-
expect((0, _standardDeviation.standardDeviation)([])).toBe(0);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _subtract = require("@/Math/subtract");
|
|
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("subtract function", function () {
|
|
11
|
-
test.each([{
|
|
12
|
-
a: [1, 1],
|
|
13
|
-
expected: 0
|
|
14
|
-
}, {
|
|
15
|
-
a: [1.1, 1],
|
|
16
|
-
expected: 0.1
|
|
17
|
-
}, {
|
|
18
|
-
a: [1, 1.1],
|
|
19
|
-
expected: -0.1
|
|
20
|
-
}, {
|
|
21
|
-
a: [1, 1, 1],
|
|
22
|
-
expected: -1
|
|
23
|
-
}, {
|
|
24
|
-
a: [5, 2, 1],
|
|
25
|
-
expected: 2
|
|
26
|
-
}, {
|
|
27
|
-
a: [10, 1, 1, 1],
|
|
28
|
-
expected: 7
|
|
29
|
-
}])("subtracting $a should result in $expected", function (_ref) {
|
|
30
|
-
var a = _ref.a,
|
|
31
|
-
expected = _ref.expected;
|
|
32
|
-
expect(_subtract.subtract.apply(void 0, _toConsumableArray(a))).toBe(expected);
|
|
33
|
-
});
|
|
34
|
-
describe("floating point precision", function () {
|
|
35
|
-
it("should handle floating point precision correctly", function () {
|
|
36
|
-
// These operations would normally have floating point errors
|
|
37
|
-
expect((0, _subtract.subtract)(0.3, 0.1)).toBe(0.2);
|
|
38
|
-
expect((0, _subtract.subtract)(0.7, 0.1)).toBe(0.6);
|
|
39
|
-
expect((0, _subtract.subtract)(1.0, 0.9)).toBe(0.1);
|
|
40
|
-
});
|
|
41
|
-
it("should handle multiple decimal places", function () {
|
|
42
|
-
expect((0, _subtract.subtract)(0.12345, 0.00001)).toBe(0.12344);
|
|
43
|
-
expect((0, _subtract.subtract)(1.23456, 0.00001, 0.00002)).toBe(1.23453);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _toBaseN = require("@/Math/toBaseN");
|
|
4
|
-
describe("toBaseN function", function () {
|
|
5
|
-
describe("binary (base 2)", function () {
|
|
6
|
-
it("should convert decimal numbers to binary strings", function () {
|
|
7
|
-
expect((0, _toBaseN.toBaseN)(1)).toBe("1");
|
|
8
|
-
expect((0, _toBaseN.toBaseN)(2)).toBe("10");
|
|
9
|
-
expect((0, _toBaseN.toBaseN)(3)).toBe("11");
|
|
10
|
-
expect((0, _toBaseN.toBaseN)(4)).toBe("100");
|
|
11
|
-
expect((0, _toBaseN.toBaseN)(5)).toBe("101");
|
|
12
|
-
expect((0, _toBaseN.toBaseN)(6)).toBe("110");
|
|
13
|
-
expect((0, _toBaseN.toBaseN)(112)).toBe("1110000");
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
describe("base 4", function () {
|
|
17
|
-
it("should convert decimal numbers to base 4 strings", function () {
|
|
18
|
-
expect((0, _toBaseN.toBaseN)(7, 4)).toBe("13");
|
|
19
|
-
expect((0, _toBaseN.toBaseN)(8, 4)).toBe("20");
|
|
20
|
-
expect((0, _toBaseN.toBaseN)(9, 4)).toBe("21");
|
|
21
|
-
expect((0, _toBaseN.toBaseN)(112, 4)).toBe("1300");
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
describe("octal (base 8)", function () {
|
|
25
|
-
it("should convert decimal numbers to octal strings", function () {
|
|
26
|
-
expect((0, _toBaseN.toBaseN)(7, 8)).toBe("7");
|
|
27
|
-
expect((0, _toBaseN.toBaseN)(8, 8)).toBe("10");
|
|
28
|
-
expect((0, _toBaseN.toBaseN)(9, 8)).toBe("11");
|
|
29
|
-
expect((0, _toBaseN.toBaseN)(112, 8)).toBe("160");
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
describe("hexadecimal (base 16)", function () {
|
|
33
|
-
it("should convert decimal numbers to hexadecimal strings", function () {
|
|
34
|
-
expect((0, _toBaseN.toBaseN)(10, 16)).toBe("a");
|
|
35
|
-
expect((0, _toBaseN.toBaseN)(15, 16)).toBe("f");
|
|
36
|
-
expect((0, _toBaseN.toBaseN)(16, 16)).toBe("10");
|
|
37
|
-
expect((0, _toBaseN.toBaseN)(255, 16)).toBe("ff");
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _toCelsius = require("@/Math/toCelsius");
|
|
4
|
-
describe("toCelsius function", function () {
|
|
5
|
-
it("should convert Kelvin to Celsius", function () {
|
|
6
|
-
expect((0, _toCelsius.toCelsius)(273.15)).toBe(0);
|
|
7
|
-
expect((0, _toCelsius.toCelsius)(300)).toBe(26.85);
|
|
8
|
-
expect((0, _toCelsius.toCelsius)(373.15)).toBe(100);
|
|
9
|
-
expect((0, _toCelsius.toCelsius)(0)).toBe(-273.15);
|
|
10
|
-
});
|
|
11
|
-
it("should handle non-standard temperatures", function () {
|
|
12
|
-
expect((0, _toCelsius.toCelsius)(32)).toBe(-241.15);
|
|
13
|
-
expect((0, _toCelsius.toCelsius)(1000)).toBe(726.85);
|
|
14
|
-
});
|
|
15
|
-
it("should handle negative Kelvin values (though physically impossible)", function () {
|
|
16
|
-
expect((0, _toCelsius.toCelsius)(-100)).toBe(-373.15);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _toKelvin = require("@/Math/toKelvin");
|
|
4
|
-
describe("toKelvin function", function () {
|
|
5
|
-
it("should convert Celsius to Kelvin", function () {
|
|
6
|
-
expect((0, _toKelvin.toKelvin)(0)).toBe(273.15);
|
|
7
|
-
expect((0, _toKelvin.toKelvin)(26.85)).toBe(300);
|
|
8
|
-
expect((0, _toKelvin.toKelvin)(100)).toBe(373.15);
|
|
9
|
-
});
|
|
10
|
-
it("should handle negative Celsius values", function () {
|
|
11
|
-
expect((0, _toKelvin.toKelvin)(-40)).toBe(233.15);
|
|
12
|
-
expect((0, _toKelvin.toKelvin)(-273.15)).toBe(0);
|
|
13
|
-
});
|
|
14
|
-
it("should handle extreme temperatures", function () {
|
|
15
|
-
expect((0, _toKelvin.toKelvin)(1000)).toBe(1273.15);
|
|
16
|
-
expect((0, _toKelvin.toKelvin)(-300)).toBe(-26.85); // Below absolute zero (physically impossible)
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _uuidv = require("@/Math/uuidv7");
|
|
4
|
-
describe("uuidv7 function", function () {
|
|
5
|
-
it("should generate UUID v7 with correct format", function () {
|
|
6
|
-
var uuid = (0, _uuidv.uuidv7)();
|
|
7
|
-
var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
8
|
-
expect(uuid).toMatch(uuidRegex);
|
|
9
|
-
});
|
|
10
|
-
it("should generate unique UUIDs", function () {
|
|
11
|
-
var uuid1 = (0, _uuidv.uuidv7)();
|
|
12
|
-
var uuid2 = (0, _uuidv.uuidv7)();
|
|
13
|
-
expect(uuid1).not.toBe(uuid2);
|
|
14
|
-
});
|
|
15
|
-
it("should have version 7", function () {
|
|
16
|
-
var uuid = (0, _uuidv.uuidv7)();
|
|
17
|
-
var version = uuid.split("-")[2][0];
|
|
18
|
-
expect(version).toBe("7");
|
|
19
|
-
});
|
|
20
|
-
it("should have correct variant", function () {
|
|
21
|
-
var uuid = (0, _uuidv.uuidv7)();
|
|
22
|
-
var variant = uuid.split("-")[3][0];
|
|
23
|
-
expect(["8", "9", "a", "b"]).toContain(variant);
|
|
24
|
-
});
|
|
25
|
-
it("should generate non-colliding UUIDs", function () {
|
|
26
|
-
var uuids = new Set();
|
|
27
|
-
for (var index = 0; index < 1000; index++) {
|
|
28
|
-
var uuid = (0, _uuidv.uuidv7)();
|
|
29
|
-
expect(uuids.has(uuid)).toBe(false);
|
|
30
|
-
uuids.add(uuid);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _valueSwap = require("@/Math/valueSwap");
|
|
4
|
-
describe("valueSwap function", function () {
|
|
5
|
-
it("should keep order when x < y", function () {
|
|
6
|
-
expect((0, _valueSwap.valueSwap)(1, 2)).toEqual([1, 2]);
|
|
7
|
-
expect((0, _valueSwap.valueSwap)(-2, -1)).toEqual([-2, -1]);
|
|
8
|
-
expect((0, _valueSwap.valueSwap)(0.1, 0.2)).toEqual([0.1, 0.2]);
|
|
9
|
-
});
|
|
10
|
-
it("should swap order when x > y", function () {
|
|
11
|
-
expect((0, _valueSwap.valueSwap)(2, 1)).toEqual([1, 2]);
|
|
12
|
-
expect((0, _valueSwap.valueSwap)(-1, -2)).toEqual([-2, -1]);
|
|
13
|
-
expect((0, _valueSwap.valueSwap)(0.2, 0.1)).toEqual([0.1, 0.2]);
|
|
14
|
-
});
|
|
15
|
-
it("should handle equal numbers", function () {
|
|
16
|
-
expect((0, _valueSwap.valueSwap)(1, 1)).toEqual([1, 1]);
|
|
17
|
-
expect((0, _valueSwap.valueSwap)(0, 0)).toEqual([0, 0]);
|
|
18
|
-
expect((0, _valueSwap.valueSwap)(-1, -1)).toEqual([-1, -1]);
|
|
19
|
-
});
|
|
20
|
-
it("should handle decimal numbers", function () {
|
|
21
|
-
expect((0, _valueSwap.valueSwap)(1.5, 1.2)).toEqual([1.2, 1.5]);
|
|
22
|
-
expect((0, _valueSwap.valueSwap)(0.5, 1.5)).toEqual([0.5, 1.5]);
|
|
23
|
-
});
|
|
24
|
-
it("should handle negative numbers", function () {
|
|
25
|
-
expect((0, _valueSwap.valueSwap)(-5, 5)).toEqual([-5, 5]);
|
|
26
|
-
expect((0, _valueSwap.valueSwap)(5, -5)).toEqual([-5, 5]);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _xoshiro = require("@/Math/xoshiro256");
|
|
4
|
-
describe("xoshiro256 function", function () {
|
|
5
|
-
it("should generate random numbers within the default range", function () {
|
|
6
|
-
var state = [1, 2, 3, 4];
|
|
7
|
-
var result = (0, _xoshiro.xoshiro256)(state);
|
|
8
|
-
expect(result).toBeGreaterThanOrEqual(0);
|
|
9
|
-
expect(result).toBeLessThan(1);
|
|
10
|
-
});
|
|
11
|
-
it("should generate the same sequence with the same seed values", function () {
|
|
12
|
-
var state1 = [1, 2, 3, 4];
|
|
13
|
-
var state2 = [1, 2, 3, 4];
|
|
14
|
-
var result1 = (0, _xoshiro.xoshiro256)(state1);
|
|
15
|
-
var result2 = (0, _xoshiro.xoshiro256)(state2);
|
|
16
|
-
expect(result1).toBe(result2);
|
|
17
|
-
});
|
|
18
|
-
it("should generate different sequences with different seed values", function () {
|
|
19
|
-
var state1 = [1, 2, 3, 4];
|
|
20
|
-
var state2 = [4, 3, 2, 1];
|
|
21
|
-
var result1 = (0, _xoshiro.xoshiro256)(state1);
|
|
22
|
-
var result2 = (0, _xoshiro.xoshiro256)(state2);
|
|
23
|
-
expect(result1).not.toBe(result2);
|
|
24
|
-
});
|
|
25
|
-
it("should respect the min and max parameters", function () {
|
|
26
|
-
var state = [1, 2, 3, 4];
|
|
27
|
-
var min = 10;
|
|
28
|
-
var max = 20;
|
|
29
|
-
var result = (0, _xoshiro.xoshiro256)(state, min, max);
|
|
30
|
-
expect(result).toBeGreaterThanOrEqual(min);
|
|
31
|
-
expect(result).toBeLessThan(max);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _has = require("@/Object/has");
|
|
4
|
-
describe("has", function () {
|
|
5
|
-
it("should return true for existing nested path (string)", function () {
|
|
6
|
-
expect((0, _has.has)({
|
|
7
|
-
a: {
|
|
8
|
-
b: 1
|
|
9
|
-
}
|
|
10
|
-
}, "a.b")).toBe(true);
|
|
11
|
-
});
|
|
12
|
-
it("should return true for existing nested path (array)", function () {
|
|
13
|
-
expect((0, _has.has)({
|
|
14
|
-
a: {
|
|
15
|
-
b: 1
|
|
16
|
-
}
|
|
17
|
-
}, ["a", "b"])).toBe(true);
|
|
18
|
-
});
|
|
19
|
-
it("should return false for non-existing nested path (string)", function () {
|
|
20
|
-
expect((0, _has.has)({
|
|
21
|
-
a: {
|
|
22
|
-
b: 1
|
|
23
|
-
}
|
|
24
|
-
}, "a.c")).toBe(false);
|
|
25
|
-
});
|
|
26
|
-
it("should return false for non-existing nested path (array)", function () {
|
|
27
|
-
expect((0, _has.has)({
|
|
28
|
-
a: {
|
|
29
|
-
b: 1
|
|
30
|
-
}
|
|
31
|
-
}, ["a", "c"])).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
it("should return false for non-existing top-level path", function () {
|
|
34
|
-
expect((0, _has.has)({
|
|
35
|
-
a: {
|
|
36
|
-
b: 1
|
|
37
|
-
}
|
|
38
|
-
}, "b")).toBe(false);
|
|
39
|
-
});
|
|
40
|
-
it("should handle empty path (string)", function () {
|
|
41
|
-
expect((0, _has.has)({
|
|
42
|
-
a: {
|
|
43
|
-
b: 1
|
|
44
|
-
}
|
|
45
|
-
}, "")).toBe(false);
|
|
46
|
-
});
|
|
47
|
-
it("should handle empty path (array)", function () {
|
|
48
|
-
expect((0, _has.has)({
|
|
49
|
-
a: {
|
|
50
|
-
b: 1
|
|
51
|
-
}
|
|
52
|
-
}, [])).toBe(true);
|
|
53
|
-
});
|
|
54
|
-
it("should handle null or undefined object", function () {
|
|
55
|
-
// @ts-expect-error
|
|
56
|
-
expect((0, _has.has)(null, "a.b")).toBe(false);
|
|
57
|
-
// @ts-expect-error
|
|
58
|
-
expect((0, _has.has)(undefined, "a.b")).toBe(false);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _keyBy = require("@/Object/keyBy");
|
|
4
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
5
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
6
|
-
describe("keyBy", function () {
|
|
7
|
-
it("should create an object using property name as key", function () {
|
|
8
|
-
var input = [{
|
|
9
|
-
id: "a1",
|
|
10
|
-
name: "Alice"
|
|
11
|
-
}, {
|
|
12
|
-
id: "b2",
|
|
13
|
-
name: "Bob"
|
|
14
|
-
}];
|
|
15
|
-
var result = {
|
|
16
|
-
a1: {
|
|
17
|
-
id: "a1",
|
|
18
|
-
name: "Alice"
|
|
19
|
-
},
|
|
20
|
-
b2: {
|
|
21
|
-
id: "b2",
|
|
22
|
-
name: "Bob"
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
var output = (0, _keyBy.keyBy)(input, "id");
|
|
26
|
-
var lodashOutput = _lodash["default"].keyBy(input, "id");
|
|
27
|
-
expect(output).toEqual(result);
|
|
28
|
-
expect(lodashOutput).toEqual(result);
|
|
29
|
-
});
|
|
30
|
-
it("should generate keys using a custom function", function () {
|
|
31
|
-
var input = [{
|
|
32
|
-
dir: "left",
|
|
33
|
-
code: 97
|
|
34
|
-
}, {
|
|
35
|
-
dir: "right",
|
|
36
|
-
code: 100
|
|
37
|
-
}];
|
|
38
|
-
var result = {
|
|
39
|
-
a: {
|
|
40
|
-
dir: "left",
|
|
41
|
-
code: 97
|
|
42
|
-
},
|
|
43
|
-
d: {
|
|
44
|
-
dir: "right",
|
|
45
|
-
code: 100
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var output = (0, _keyBy.keyBy)(input, function (o) {
|
|
49
|
-
return String.fromCharCode(o.code);
|
|
50
|
-
});
|
|
51
|
-
var lodashOutput = _lodash["default"].keyBy(input, function (o) {
|
|
52
|
-
return String.fromCharCode(o.code);
|
|
53
|
-
});
|
|
54
|
-
expect(output).toEqual(result);
|
|
55
|
-
expect(lodashOutput).toEqual(result);
|
|
56
|
-
});
|
|
57
|
-
it("should return an empty object for an empty array", function () {
|
|
58
|
-
var result = {};
|
|
59
|
-
var output = (0, _keyBy.keyBy)([], "id");
|
|
60
|
-
var lodashOutput = _lodash["default"].keyBy([], "id");
|
|
61
|
-
expect(output).toEqual(result);
|
|
62
|
-
expect(lodashOutput).toEqual(result);
|
|
63
|
-
});
|
|
64
|
-
it("should use later values when there are duplicate keys", function () {
|
|
65
|
-
var input = [{
|
|
66
|
-
id: "a1",
|
|
67
|
-
name: "Alice"
|
|
68
|
-
}, {
|
|
69
|
-
id: "a1",
|
|
70
|
-
name: "Alex"
|
|
71
|
-
}];
|
|
72
|
-
var result = {
|
|
73
|
-
a1: {
|
|
74
|
-
id: "a1",
|
|
75
|
-
name: "Alex"
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
var output = (0, _keyBy.keyBy)(input, "id");
|
|
79
|
-
var lodashOutput = _lodash["default"].keyBy(input, "id");
|
|
80
|
-
expect(output).toEqual(result);
|
|
81
|
-
expect(lodashOutput).toEqual(result);
|
|
82
|
-
});
|
|
83
|
-
it("should accept an object as input", function () {
|
|
84
|
-
var input = {
|
|
85
|
-
first: {
|
|
86
|
-
id: "a1",
|
|
87
|
-
name: "Alice"
|
|
88
|
-
},
|
|
89
|
-
second: {
|
|
90
|
-
id: "b2",
|
|
91
|
-
name: "Bob"
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
var result = {
|
|
95
|
-
a1: {
|
|
96
|
-
id: "a1",
|
|
97
|
-
name: "Alice"
|
|
98
|
-
},
|
|
99
|
-
b2: {
|
|
100
|
-
id: "b2",
|
|
101
|
-
name: "Bob"
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
var output = (0, _keyBy.keyBy)(input, "id");
|
|
105
|
-
var lodashOutput = _lodash["default"].keyBy(input, "id");
|
|
106
|
-
expect(output).toEqual(result);
|
|
107
|
-
expect(lodashOutput).toEqual(result);
|
|
108
|
-
});
|
|
109
|
-
it("should act as identity function when iteratee is not specified", function () {
|
|
110
|
-
var input = ["a", "b"];
|
|
111
|
-
var result = {
|
|
112
|
-
a: "a",
|
|
113
|
-
b: "b"
|
|
114
|
-
};
|
|
115
|
-
var output = (0, _keyBy.keyBy)(input);
|
|
116
|
-
var lodashOutput = _lodash["default"].keyBy(input);
|
|
117
|
-
expect(output).toEqual(result);
|
|
118
|
-
expect(lodashOutput).toEqual(result);
|
|
119
|
-
});
|
|
120
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|