umt 2.2.1 → 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/Function/curry.d.ts +141 -0
- package/module/Function/curry.js +11 -0
- package/module/Function/curry.js.map +1 -0
- package/module/Function/index.d.ts +1 -0
- package/module/Function/index.js +2 -0
- package/module/Function/index.js.map +1 -0
- package/module/Tool/index.d.ts +1 -0
- package/module/Tool/index.js +1 -0
- package/module/Tool/index.js.map +1 -1
- package/module/Tool/pipe.d.ts +66 -0
- package/module/Tool/pipe.js +98 -0
- package/module/Tool/pipe.js.map +1 -0
- package/module/Validate/index.d.ts +1 -0
- package/module/Validate/index.js +1 -0
- package/module/Validate/index.js.map +1 -1
- package/module/Validate/isString.d.ts +9 -0
- package/module/Validate/isString.js +12 -0
- package/module/Validate/isString.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/Function/curry.d.ts +141 -0
- package/module/es5/Function/curry.js +38 -0
- package/module/es5/Function/index.d.ts +1 -0
- package/module/es5/Function/index.js +16 -0
- package/module/es5/Tool/index.d.ts +1 -0
- package/module/es5/Tool/index.js +11 -0
- package/module/es5/Tool/pipe.d.ts +66 -0
- package/module/es5/Tool/pipe.js +129 -0
- package/module/es5/Validate/index.d.ts +1 -0
- package/module/es5/Validate/index.js +11 -0
- package/module/es5/Validate/isString.d.ts +9 -0
- package/module/es5/Validate/isString.js +16 -0
- package/module/es5/Validate/object/core.d.ts +2 -6
- package/module/es5/Validate/type.d.ts +1 -0
- package/module/es5/index.d.ts +1 -0
- package/module/es5/index.js +11 -0
- package/module/es5/tsconfig.tsbuildinfo +1 -1
- package/module/index.d.ts +1 -0
- package/module/index.js +1 -0
- package/module/index.js.map +1 -1
- package/package.json +26 -22
- 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/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/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,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _degToRad = require("@/Math/degToRad");
|
|
4
|
-
describe("degToRad", function () {
|
|
5
|
-
// Normal test cases
|
|
6
|
-
test("degToRad: Normal Cases", function () {
|
|
7
|
-
expect((0, _degToRad.degToRad)(0)).toBeCloseTo(0);
|
|
8
|
-
expect((0, _degToRad.degToRad)(90)).toBeCloseTo(Math.PI / 2);
|
|
9
|
-
expect((0, _degToRad.degToRad)(180)).toBeCloseTo(Math.PI);
|
|
10
|
-
expect((0, _degToRad.degToRad)(270)).toBeCloseTo(3 * Math.PI / 2);
|
|
11
|
-
expect((0, _degToRad.degToRad)(360)).toBeCloseTo(2 * Math.PI);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// Negative angles
|
|
15
|
-
test("degToRad: Negative Angles", function () {
|
|
16
|
-
expect((0, _degToRad.degToRad)(-90)).toBeCloseTo(-Math.PI / 2);
|
|
17
|
-
expect((0, _degToRad.degToRad)(-180)).toBeCloseTo(-Math.PI);
|
|
18
|
-
expect((0, _degToRad.degToRad)(-270)).toBeCloseTo(-3 * Math.PI / 2);
|
|
19
|
-
expect((0, _degToRad.degToRad)(-360)).toBeCloseTo(-2 * Math.PI);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// Floating point angles
|
|
23
|
-
test("degToRad: Floating Point Angles", function () {
|
|
24
|
-
expect((0, _degToRad.degToRad)(45.5)).toBeCloseTo(Math.PI / 4 + Math.PI / 360);
|
|
25
|
-
expect((0, _degToRad.degToRad)(60.7)).toBeCloseTo(Math.PI * 60.7 / 180);
|
|
26
|
-
expect((0, _degToRad.degToRad)(120.2)).toBeCloseTo(Math.PI * 120.2 / 180);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// Angles greater than 360 and 1000 degrees
|
|
30
|
-
test("degToRad: Angles Greater Than 360 and 1000 Degrees", function () {
|
|
31
|
-
expect((0, _degToRad.degToRad)(450)).toBeCloseTo(5 * Math.PI / 2);
|
|
32
|
-
expect((0, _degToRad.degToRad)(720)).toBeCloseTo(4 * Math.PI);
|
|
33
|
-
expect((0, _degToRad.degToRad)(1080)).toBeCloseTo(6 * Math.PI);
|
|
34
|
-
expect((0, _degToRad.degToRad)(1440)).toBeCloseTo(8 * Math.PI);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// NaN and Infinity cases
|
|
38
|
-
test("degToRad: NaN and Infinity", function () {
|
|
39
|
-
expect((0, _degToRad.degToRad)(Number.NaN)).toBe(Number.NaN);
|
|
40
|
-
expect((0, _degToRad.degToRad)(Number.POSITIVE_INFINITY)).toBe(Number.POSITIVE_INFINITY);
|
|
41
|
-
expect((0, _degToRad.degToRad)(Number.NEGATIVE_INFINITY)).toBe(Number.NEGATIVE_INFINITY);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// Invalid inputs
|
|
45
|
-
test("degToRad: Invalid Inputs", function () {
|
|
46
|
-
expect((0, _degToRad.degToRad)("90")).toBeCloseTo(Math.PI / 2);
|
|
47
|
-
expect((0, _degToRad.degToRad)([90])).toBeCloseTo(Math.PI / 2);
|
|
48
|
-
expect((0, _degToRad.degToRad)({})).toBe(Number.NaN);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _deviationValue = require("@/Math/deviationValue");
|
|
4
|
-
// Tests for standard score calculation
|
|
5
|
-
describe("deviationValue", function () {
|
|
6
|
-
// Test with normal input values
|
|
7
|
-
test("should handle normal input values", function () {
|
|
8
|
-
expect((0, _deviationValue.deviationValue)(100, 50, 10)).toBe(100);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
// Test with value equal to mean
|
|
12
|
-
test("should handle value equal to mean", function () {
|
|
13
|
-
expect((0, _deviationValue.deviationValue)(50, 50, 10)).toBe(50);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
// Test with zero standard deviation
|
|
17
|
-
test("should handle zero standard deviation", function () {
|
|
18
|
-
expect((0, _deviationValue.deviationValue)(100, 50, 0)).toBe(Number.POSITIVE_INFINITY);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// Test with negative values
|
|
22
|
-
test("should handle negative values", function () {
|
|
23
|
-
expect((0, _deviationValue.deviationValue)(-20, 0, 20)).toBe(40);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Test with floating point numbers
|
|
27
|
-
test("should handle floating point numbers", function () {
|
|
28
|
-
expect((0, _deviationValue.deviationValue)(55.5, 50, 10)).toBeCloseTo(55.5);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _division = require("@/Math/division");
|
|
4
|
-
describe("division function", function () {
|
|
5
|
-
describe("basic integer division", function () {
|
|
6
|
-
it("should correctly divide integers", function () {
|
|
7
|
-
expect((0, _division.division)(10, 2)).toBe(5);
|
|
8
|
-
expect((0, _division.division)(30, 5)).toBe(6);
|
|
9
|
-
});
|
|
10
|
-
it("should handle large number divided by small number", function () {
|
|
11
|
-
expect((0, _division.division)(1000, 10)).toBe(100);
|
|
12
|
-
expect((0, _division.division)(10000, 100)).toBe(100);
|
|
13
|
-
});
|
|
14
|
-
it("should handle small number divided by large number", function () {
|
|
15
|
-
expect((0, _division.division)(10, 100)).toBe(0.1);
|
|
16
|
-
expect((0, _division.division)(1, 1000)).toBe(0.001);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
describe("division with remainder", function () {
|
|
20
|
-
it("should handle division with remainder when isFloor is true", function () {
|
|
21
|
-
expect((0, _division.division)(7, 2, true)).toBe(3.5);
|
|
22
|
-
expect((0, _division.division)(3, 5, true)).toBe(0.6);
|
|
23
|
-
});
|
|
24
|
-
it("should return quotient and remainder when isFloor is false", function () {
|
|
25
|
-
expect((0, _division.division)(10, 3, false)).toEqual([3, 1]);
|
|
26
|
-
expect((0, _division.division)(7, 2, false)).toEqual([3, 1]);
|
|
27
|
-
expect((0, _division.division)(3, 5, false)).toEqual([0, 3]);
|
|
28
|
-
});
|
|
29
|
-
it("should handle large numbers with remainder", function () {
|
|
30
|
-
expect((0, _division.division)(1000, 3, false)).toEqual([333, 1]);
|
|
31
|
-
expect((0, _division.division)(10000, 7, false)).toEqual([1428, 4]);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
describe("decimal numbers", function () {
|
|
35
|
-
it("should handle decimal numbers with different lengths", function () {
|
|
36
|
-
expect((0, _division.division)(10.5, 2.1)).toBe(5);
|
|
37
|
-
expect((0, _division.division)(0.1, 0.2)).toBe(0.5);
|
|
38
|
-
expect((0, _division.division)(0.001, 0.1)).toBe(0.01);
|
|
39
|
-
expect((0, _division.division)(0.1, 0.001)).toBe(100);
|
|
40
|
-
expect((0, _division.division)(0.0001, 0.01)).toBe(0.01);
|
|
41
|
-
});
|
|
42
|
-
it("should handle decimal numbers with same length", function () {
|
|
43
|
-
expect((0, _division.division)(1.1, 2.2)).toBe(0.5);
|
|
44
|
-
expect((0, _division.division)(0.01, 0.02)).toBe(0.5);
|
|
45
|
-
});
|
|
46
|
-
it("should handle complex decimal combinations", function () {
|
|
47
|
-
expect((0, _division.division)(1.23456, 2.1)).toBeCloseTo(0.587885714);
|
|
48
|
-
expect((0, _division.division)(0.0001, 0.0003)).toBeCloseTo(0.333333333);
|
|
49
|
-
expect((0, _division.division)(123.456, 0.789)).toBeCloseTo(156.4715);
|
|
50
|
-
});
|
|
51
|
-
it("should handle decimal numbers with remainder", function () {
|
|
52
|
-
expect((0, _division.division)(1.5, 0.7, false)).toEqual([2, 1]);
|
|
53
|
-
expect((0, _division.division)(0.123, 0.0456, false)).toEqual([2, 123]);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
describe("edge cases", function () {
|
|
57
|
-
it("should return NaN for division by zero", function () {
|
|
58
|
-
expect((0, _division.division)(1, 0)).toBe(Number.NaN);
|
|
59
|
-
expect((0, _division.division)(-1, 0)).toBe(Number.NaN);
|
|
60
|
-
expect((0, _division.division)(-1, 0, false)).toEqual([Number.NaN, Number.NaN]);
|
|
61
|
-
expect((0, _division.division)(0, 0)).toBe(Number.NaN);
|
|
62
|
-
expect((0, _division.division)(0, 0, false)).toEqual([Number.NaN, Number.NaN]);
|
|
63
|
-
});
|
|
64
|
-
it("should handle zero dividend", function () {
|
|
65
|
-
expect((0, _division.division)(0, 1)).toBe(0);
|
|
66
|
-
expect((0, _division.division)(0, -1)).toBe(-0);
|
|
67
|
-
expect((0, _division.division)(0, 2, false)).toEqual([0, 0]);
|
|
68
|
-
expect((0, _division.division)(0, -2, false)).toEqual([-0, 0]);
|
|
69
|
-
});
|
|
70
|
-
it("should handle negative numbers", function () {
|
|
71
|
-
expect((0, _division.division)(-10, 2)).toBe(-5);
|
|
72
|
-
expect((0, _division.division)(10, -2)).toBe(-5);
|
|
73
|
-
expect((0, _division.division)(-10, -2)).toBe(5);
|
|
74
|
-
});
|
|
75
|
-
it("should handle negative decimals", function () {
|
|
76
|
-
expect((0, _division.division)(-0.16, 0.2)).toBe(-0.8);
|
|
77
|
-
expect((0, _division.division)(0.16, -0.2)).toBe(-0.8);
|
|
78
|
-
expect((0, _division.division)(-0.16, -0.2)).toBe(0.8);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _factorial = require("@/Math/factorial");
|
|
4
|
-
describe("factorial", function () {
|
|
5
|
-
test("should return 1 for factorial of 0", function () {
|
|
6
|
-
expect((0, _factorial.factorial)(0)).toBe(1);
|
|
7
|
-
});
|
|
8
|
-
test("should return 1 for factorial of 1", function () {
|
|
9
|
-
expect((0, _factorial.factorial)(1)).toBe(1);
|
|
10
|
-
});
|
|
11
|
-
test("should correctly calculate factorial of positive integers", function () {
|
|
12
|
-
expect((0, _factorial.factorial)(2)).toBe(2);
|
|
13
|
-
expect((0, _factorial.factorial)(3)).toBe(6);
|
|
14
|
-
expect((0, _factorial.factorial)(4)).toBe(24);
|
|
15
|
-
expect((0, _factorial.factorial)(5)).toBe(120);
|
|
16
|
-
expect((0, _factorial.factorial)(6)).toBe(720);
|
|
17
|
-
expect((0, _factorial.factorial)(7)).toBe(5040);
|
|
18
|
-
expect((0, _factorial.factorial)(8)).toBe(40320);
|
|
19
|
-
expect((0, _factorial.factorial)(9)).toBe(362880);
|
|
20
|
-
expect((0, _factorial.factorial)(10)).toBe(3628800);
|
|
21
|
-
});
|
|
22
|
-
test("should return 1 for negative numbers", function () {
|
|
23
|
-
expect((0, _factorial.factorial)(-1)).toBe(1);
|
|
24
|
-
expect((0, _factorial.factorial)(-5)).toBe(1);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _factorize = require("@/Math/factorize");
|
|
4
|
-
describe("factorize", function () {
|
|
5
|
-
describe("basic factorization", function () {
|
|
6
|
-
test("should correctly factorize composite numbers", function () {
|
|
7
|
-
expect((0, _factorize.factorize)(12)).toEqual([2, 2, 3]);
|
|
8
|
-
expect((0, _factorize.factorize)(14)).toEqual([2, 7]);
|
|
9
|
-
expect((0, _factorize.factorize)(15)).toEqual([3, 5]);
|
|
10
|
-
expect((0, _factorize.factorize)(18)).toEqual([2, 3, 3]);
|
|
11
|
-
expect((0, _factorize.factorize)(20)).toEqual([2, 2, 5]);
|
|
12
|
-
});
|
|
13
|
-
test("should handle powers of the same prime", function () {
|
|
14
|
-
expect((0, _factorize.factorize)(16)).toEqual([2, 2, 2, 2]);
|
|
15
|
-
expect((0, _factorize.factorize)(27)).toEqual([3, 3, 3]);
|
|
16
|
-
expect((0, _factorize.factorize)(32)).toEqual([2, 2, 2, 2, 2]);
|
|
17
|
-
});
|
|
18
|
-
test("should handle prime numbers", function () {
|
|
19
|
-
expect((0, _factorize.factorize)(17)).toEqual([17]);
|
|
20
|
-
expect((0, _factorize.factorize)(19)).toEqual([19]);
|
|
21
|
-
expect((0, _factorize.factorize)(23)).toEqual([23]);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
describe("edge cases", function () {
|
|
25
|
-
test("should handle negative numbers", function () {
|
|
26
|
-
expect((0, _factorize.factorize)(-12)).toEqual([2, 2, 3]);
|
|
27
|
-
expect((0, _factorize.factorize)(-15)).toEqual([3, 5]);
|
|
28
|
-
});
|
|
29
|
-
test("should handle zero and one", function () {
|
|
30
|
-
expect((0, _factorize.factorize)(0)).toEqual([]);
|
|
31
|
-
expect((0, _factorize.factorize)(1)).toEqual([]);
|
|
32
|
-
});
|
|
33
|
-
test("should handle large numbers", function () {
|
|
34
|
-
expect((0, _factorize.factorize)(997)).toEqual([997]); // Large prime
|
|
35
|
-
expect((0, _factorize.factorize)(1000)).toEqual([2, 2, 2, 5, 5, 5]);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _flexibleNumberConversion = require("@/Math/flexibleNumberConversion");
|
|
4
|
-
describe("flexibleNumberConversion", function () {
|
|
5
|
-
// Basic numeric input
|
|
6
|
-
describe("Basic numeric input", function () {
|
|
7
|
-
test("should return positive integers as-is", function () {
|
|
8
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(123)).toBe(123);
|
|
9
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(456)).toBe(456);
|
|
10
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(789)).toBe(789);
|
|
11
|
-
});
|
|
12
|
-
test("should return negative integers as-is", function () {
|
|
13
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(-123)).toBe(-123);
|
|
14
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(-456)).toBe(-456);
|
|
15
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(-789)).toBe(-789);
|
|
16
|
-
});
|
|
17
|
-
test("should return zero as-is", function () {
|
|
18
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(0)).toBe(0);
|
|
19
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(-0)).toBe(-0);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// String numeric input
|
|
24
|
-
describe("String numeric input", function () {
|
|
25
|
-
test("should properly convert positive integer strings", function () {
|
|
26
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("123")).toBe(123);
|
|
27
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("456")).toBe(456);
|
|
28
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("789")).toBe(789);
|
|
29
|
-
});
|
|
30
|
-
test("should properly convert negative integer strings", function () {
|
|
31
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-123")).toBe(-123);
|
|
32
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-456")).toBe(-456);
|
|
33
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-789")).toBe(-789);
|
|
34
|
-
});
|
|
35
|
-
test("should properly convert decimal strings", function () {
|
|
36
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("3.14")).toBe(3.14);
|
|
37
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-2.718")).toBe(-2.718);
|
|
38
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("0.001")).toBe(0.001);
|
|
39
|
-
});
|
|
40
|
-
test("should correctly interpret exponential notation strings", function () {
|
|
41
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("1e3")).toBe(1000);
|
|
42
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-2.5e-3")).toBe(-0.0025);
|
|
43
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("6.022e23")).toBe(6.022e23);
|
|
44
|
-
});
|
|
45
|
-
test("should correctly interpret special base notation strings", function () {
|
|
46
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("0x1A")).toBe(26);
|
|
47
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("0b1011")).toBe(11);
|
|
48
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("0o77")).toBe(63);
|
|
49
|
-
});
|
|
50
|
-
test("should properly convert strings with spaces around numbers", function () {
|
|
51
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(" 123 ")).toBe(123);
|
|
52
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(" -456")).toBe(-456);
|
|
53
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("789 ")).toBe(789);
|
|
54
|
-
});
|
|
55
|
-
test("should handle strings with only plus sign", function () {
|
|
56
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("+")).toBe(Number.NaN);
|
|
57
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("+123")).toBe(123);
|
|
58
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("+0")).toBe(0);
|
|
59
|
-
});
|
|
60
|
-
test("should handle strings with invalid exponential notation", function () {
|
|
61
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("1e")).toBe(1);
|
|
62
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("e10")).toBe(Number.NaN);
|
|
63
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("2e+")).toBe(2);
|
|
64
|
-
});
|
|
65
|
-
test("should handle strings with only decimal point", function () {
|
|
66
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(".")).toBe(Number.NaN);
|
|
67
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-.")).toBe(Number.NaN);
|
|
68
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(".e1")).toBe(Number.NaN);
|
|
69
|
-
});
|
|
70
|
-
test("should handle strings that don't start with a number", function () {
|
|
71
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("px42")).toBe(Number.NaN);
|
|
72
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("meter3.14")).toBe(Number.NaN);
|
|
73
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("abc123")).toBe(Number.NaN);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
// Special numeric input
|
|
78
|
-
describe("Special numeric input", function () {
|
|
79
|
-
test("should properly handle Infinity", function () {
|
|
80
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("Infinity")).toBe(Number.POSITIVE_INFINITY);
|
|
81
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-Infinity")).toBe(Number.NEGATIVE_INFINITY);
|
|
82
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(Number.POSITIVE_INFINITY)).toBe(Number.POSITIVE_INFINITY);
|
|
83
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(Number.NEGATIVE_INFINITY)).toBe(Number.NEGATIVE_INFINITY);
|
|
84
|
-
});
|
|
85
|
-
test("should handle NaN input", function () {
|
|
86
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(Number.NaN)).toBe(Number.NaN);
|
|
87
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("NaN")).toBe(Number.NaN);
|
|
88
|
-
});
|
|
89
|
-
test("should properly handle very large numbers", function () {
|
|
90
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(Number.MAX_SAFE_INTEGER)).toBe(Number.MAX_SAFE_INTEGER);
|
|
91
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("9007199254740991")).toBe(9007199254740991);
|
|
92
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("1e308")).toBe(1e308);
|
|
93
|
-
});
|
|
94
|
-
test("should properly handle very small numbers", function () {
|
|
95
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(Number.MIN_VALUE)).toBe(Number.MIN_VALUE);
|
|
96
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("5e-324")).toBe(5e-324);
|
|
97
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-1e-308")).toBe(-1e-308);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// Invalid or special input
|
|
102
|
-
describe("Invalid or special input", function () {
|
|
103
|
-
test("should treat empty string, null, undefined as 0", function () {
|
|
104
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("")).toBe(0);
|
|
105
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(null)).toBe(0);
|
|
106
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(undefined)).toBe(0);
|
|
107
|
-
});
|
|
108
|
-
test("should return NaN for invalid strings", function () {
|
|
109
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("not a number")).toBe(Number.NaN);
|
|
110
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("abc")).toBe(Number.NaN);
|
|
111
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("abc123")).toBe(Number.NaN);
|
|
112
|
-
});
|
|
113
|
-
test("should return NaN for objects and arrays", function () {
|
|
114
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)({})).toBe(Number.NaN);
|
|
115
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)({
|
|
116
|
-
key: "value"
|
|
117
|
-
})).toBe(Number.NaN);
|
|
118
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)([])).toBe(Number.NaN);
|
|
119
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)([1, 2, 3])).toBe(Number.NaN);
|
|
120
|
-
});
|
|
121
|
-
test("should return NaN for functions", function () {
|
|
122
|
-
var func = function func() {};
|
|
123
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(func)).toBe(Number.NaN);
|
|
124
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(function () {})).toBe(Number.NaN);
|
|
125
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(function () {})).toBe(Number.NaN);
|
|
126
|
-
});
|
|
127
|
-
test("should return NaN for strings with special characters", function () {
|
|
128
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("@123")).toBe(Number.NaN);
|
|
129
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("!@#$%")).toBe(Number.NaN);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
// Complex cases
|
|
134
|
-
describe("Complex cases", function () {
|
|
135
|
-
test("should extract leading number from strings with mixed numbers and characters", function () {
|
|
136
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("42px")).toBe(42);
|
|
137
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-42px")).toBe(-42);
|
|
138
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("3.14meters")).toBe(3.14);
|
|
139
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-3.14meters")).toBe(-3.14);
|
|
140
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("1e10meters")).toBe(1e10);
|
|
141
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-1e10meters")).toBe(-1e10);
|
|
142
|
-
});
|
|
143
|
-
test("should properly handle strings with internal spaces", function () {
|
|
144
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(" 123 456 ")).toBe(123);
|
|
145
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(" -456px ")).toBe(-456);
|
|
146
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("3.14 meters")).toBe(3.14);
|
|
147
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("1e2 meters")).toBe(100);
|
|
148
|
-
});
|
|
149
|
-
test("should properly handle numbers with leading zeros", function () {
|
|
150
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("0123")).toBe(123);
|
|
151
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-0456")).toBe(-456);
|
|
152
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("000789")).toBe(789);
|
|
153
|
-
});
|
|
154
|
-
test("should properly handle numbers with leading plus sign", function () {
|
|
155
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("+123")).toBe(123);
|
|
156
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("+0")).toBe(0);
|
|
157
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("+3.14")).toBe(3.14);
|
|
158
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("+1e10")).toBe(1e10);
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
// Performance and stress tests
|
|
163
|
-
describe("Performance and stress tests", function () {
|
|
164
|
-
test("should handle large sequences of valid inputs", function () {
|
|
165
|
-
for (var i = 0; i < 1000; i++) {
|
|
166
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(i.toString())).toBe(i);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
test("should handle large sequences of invalid inputs", function () {
|
|
170
|
-
for (var i = 0; i < 1000; i++) {
|
|
171
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("invalid".concat(i))).toBe(Number.NaN);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
// Boundary value tests
|
|
177
|
-
describe("Boundary value tests", function () {
|
|
178
|
-
test("should handle Number.MAX_VALUE", function () {
|
|
179
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(Number.MAX_VALUE)).toBe(Number.MAX_VALUE);
|
|
180
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("1.7976931348623157e+308")).toBe(Number.MAX_VALUE);
|
|
181
|
-
});
|
|
182
|
-
test("should handle Number.MIN_VALUE", function () {
|
|
183
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(Number.MIN_VALUE)).toBe(Number.MIN_VALUE);
|
|
184
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("5e-324")).toBe(Number.MIN_VALUE);
|
|
185
|
-
});
|
|
186
|
-
test("should handle Number.MAX_SAFE_INTEGER", function () {
|
|
187
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(Number.MAX_SAFE_INTEGER)).toBe(Number.MAX_SAFE_INTEGER);
|
|
188
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("9007199254740991")).toBe(Number.MAX_SAFE_INTEGER);
|
|
189
|
-
});
|
|
190
|
-
test("should handle Number.MIN_SAFE_INTEGER", function () {
|
|
191
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)(Number.MIN_SAFE_INTEGER)).toBe(Number.MIN_SAFE_INTEGER);
|
|
192
|
-
expect((0, _flexibleNumberConversion.flexibleNumberConversion)("-9007199254740991")).toBe(Number.MIN_SAFE_INTEGER);
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _gcd = require("@/Math/gcd");
|
|
4
|
-
describe("gcd function", function () {
|
|
5
|
-
// Test with two positive integers
|
|
6
|
-
test("two positive integers", function () {
|
|
7
|
-
expect((0, _gcd.gcd)(56, 48)).toBe(8);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
// Test with more than two positive integers
|
|
11
|
-
test("more than two positive integers", function () {
|
|
12
|
-
expect((0, _gcd.gcd)(56, 48, 32)).toBe(8);
|
|
13
|
-
expect((0, _gcd.gcd)(56, 48, 32, 24)).toBe(8);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
// Test with zero
|
|
17
|
-
test("contains zero", function () {
|
|
18
|
-
expect((0, _gcd.gcd)(56, 0)).toBe(0);
|
|
19
|
-
expect((0, _gcd.gcd)(0, 56)).toBe(0);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// Test with one
|
|
23
|
-
test("contains one", function () {
|
|
24
|
-
expect((0, _gcd.gcd)(56, 1)).toBe(1);
|
|
25
|
-
expect((0, _gcd.gcd)(1, 56)).toBe(1);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// Test with negative numbers
|
|
29
|
-
test("contains negative numbers", function () {
|
|
30
|
-
expect((0, _gcd.gcd)(-56, 48)).toBe(8);
|
|
31
|
-
expect((0, _gcd.gcd)(56, -48)).toBe(8);
|
|
32
|
-
expect((0, _gcd.gcd)(-56, -48)).toBe(8);
|
|
33
|
-
expect((0, _gcd.gcd)(-56, 48, -32)).toBe(8);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _getDecimalLength = require("@/Math/getDecimalLength");
|
|
4
|
-
describe("getDecimalLength function", function () {
|
|
5
|
-
describe("integers", function () {
|
|
6
|
-
it("should return 0 for whole numbers", function () {
|
|
7
|
-
expect((0, _getDecimalLength.getDecimalLength)(1)).toBe(0);
|
|
8
|
-
expect((0, _getDecimalLength.getDecimalLength)(100)).toBe(0);
|
|
9
|
-
expect((0, _getDecimalLength.getDecimalLength)(-42)).toBe(0);
|
|
10
|
-
});
|
|
11
|
-
it("should return 0 for whole numbers with .0", function () {
|
|
12
|
-
expect((0, _getDecimalLength.getDecimalLength)(1.0)).toBe(0);
|
|
13
|
-
expect((0, _getDecimalLength.getDecimalLength)(42.0)).toBe(0);
|
|
14
|
-
expect((0, _getDecimalLength.getDecimalLength)(-1.0)).toBe(0);
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
describe("decimal numbers", function () {
|
|
18
|
-
it("should count decimal places correctly", function () {
|
|
19
|
-
expect((0, _getDecimalLength.getDecimalLength)(1.1)).toBe(1);
|
|
20
|
-
expect((0, _getDecimalLength.getDecimalLength)(1.11)).toBe(2);
|
|
21
|
-
expect((0, _getDecimalLength.getDecimalLength)(1.123)).toBe(3);
|
|
22
|
-
});
|
|
23
|
-
it("should handle leading zeros in decimals", function () {
|
|
24
|
-
expect((0, _getDecimalLength.getDecimalLength)(1.01)).toBe(2);
|
|
25
|
-
expect((0, _getDecimalLength.getDecimalLength)(1.001)).toBe(3);
|
|
26
|
-
expect((0, _getDecimalLength.getDecimalLength)(1.000001)).toBe(6);
|
|
27
|
-
});
|
|
28
|
-
it("should handle negative numbers with decimals", function () {
|
|
29
|
-
expect((0, _getDecimalLength.getDecimalLength)(-1.1)).toBe(1);
|
|
30
|
-
expect((0, _getDecimalLength.getDecimalLength)(-0.01)).toBe(2);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
describe("edge cases", function () {
|
|
34
|
-
it("should handle zero", function () {
|
|
35
|
-
expect((0, _getDecimalLength.getDecimalLength)(0)).toBe(0);
|
|
36
|
-
expect((0, _getDecimalLength.getDecimalLength)(0.0)).toBe(0);
|
|
37
|
-
expect((0, _getDecimalLength.getDecimalLength)(-0)).toBe(0);
|
|
38
|
-
});
|
|
39
|
-
it("should handle large decimal numbers", function () {
|
|
40
|
-
expect((0, _getDecimalLength.getDecimalLength)(123456.789)).toBe(3);
|
|
41
|
-
expect((0, _getDecimalLength.getDecimalLength)(-987654.321)).toBe(3);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _lcm = require("@/Math/lcm");
|
|
4
|
-
describe("lcm function", function () {
|
|
5
|
-
// Test with positive numbers
|
|
6
|
-
test("should handle positive numbers", function () {
|
|
7
|
-
expect((0, _lcm.lcm)(4, 5)).toBe(20);
|
|
8
|
-
expect((0, _lcm.lcm)(6, 8)).toBe(24);
|
|
9
|
-
expect((0, _lcm.lcm)(10, 15)).toBe(30);
|
|
10
|
-
expect((0, _lcm.lcm)(7, 11)).toBe(77);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// Test with zero
|
|
14
|
-
test("should handle zero values", function () {
|
|
15
|
-
expect((0, _lcm.lcm)(0, 5)).toBe(0);
|
|
16
|
-
expect((0, _lcm.lcm)(4, 0)).toBe(0);
|
|
17
|
-
expect((0, _lcm.lcm)(0, 0)).toBe(0);
|
|
18
|
-
expect((0, _lcm.lcm)(0, 10)).toBe(0);
|
|
19
|
-
expect((0, _lcm.lcm)(7, 0)).toBe(0);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// Test with one
|
|
23
|
-
test("should handle values with one", function () {
|
|
24
|
-
expect((0, _lcm.lcm)(1, 5)).toBe(5);
|
|
25
|
-
expect((0, _lcm.lcm)(4, 1)).toBe(4);
|
|
26
|
-
expect((0, _lcm.lcm)(1, 1)).toBe(1);
|
|
27
|
-
expect((0, _lcm.lcm)(1, 10)).toBe(10);
|
|
28
|
-
expect((0, _lcm.lcm)(7, 1)).toBe(7);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// Test with large numbers
|
|
32
|
-
test("should handle large numbers", function () {
|
|
33
|
-
expect((0, _lcm.lcm)(1000, 2000)).toBe(2000);
|
|
34
|
-
expect((0, _lcm.lcm)(12345, 67890)).toBe(55873470);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// Test with negative numbers
|
|
38
|
-
test("should handle negative numbers", function () {
|
|
39
|
-
expect((0, _lcm.lcm)(-4, 6)).toBe(12);
|
|
40
|
-
expect((0, _lcm.lcm)(4, -6)).toBe(12);
|
|
41
|
-
expect((0, _lcm.lcm)(-4, -6)).toBe(12);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _linearCongruentialGenerator = require("@/Math/linearCongruentialGenerator");
|
|
4
|
-
describe("linearCongruentialGenerator", function () {
|
|
5
|
-
it("should generate random numbers", function () {
|
|
6
|
-
var result = (0, _linearCongruentialGenerator.linearCongruentialGenerator)(8, 13, 3, 5);
|
|
7
|
-
expect(result).toBeGreaterThanOrEqual(0);
|
|
8
|
-
expect(result).toBe(3);
|
|
9
|
-
});
|
|
10
|
-
it("should generate the same sequence for the same seed", function () {
|
|
11
|
-
var result1 = (0, _linearCongruentialGenerator.linearCongruentialGenerator)(12345);
|
|
12
|
-
var result2 = (0, _linearCongruentialGenerator.linearCongruentialGenerator)(12345);
|
|
13
|
-
expect(result1).toBe(result2);
|
|
14
|
-
});
|
|
15
|
-
it("should generate different sequences for different seeds", function () {
|
|
16
|
-
var result1 = (0, _linearCongruentialGenerator.linearCongruentialGenerator)(12345);
|
|
17
|
-
var result2 = (0, _linearCongruentialGenerator.linearCongruentialGenerator)(54321);
|
|
18
|
-
expect(result1).not.toBe(result2);
|
|
19
|
-
});
|
|
20
|
-
it("should generate numbers with custom parameters", function () {
|
|
21
|
-
var result1 = (0, _linearCongruentialGenerator.linearCongruentialGenerator)(12345, Math.pow(2, 31), 1103515245, 12345);
|
|
22
|
-
expect(result1).toBeGreaterThanOrEqual(0);
|
|
23
|
-
expect(result1).toBe(1406932606);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _mathConverter = require("@/Math/mathConverter");
|
|
4
|
-
describe("mathConverter function", function () {
|
|
5
|
-
// Test multiplication conversion
|
|
6
|
-
test("should convert multiplication", function () {
|
|
7
|
-
expect((0, _mathConverter.mathConverter)("1250*1250")).toBe("1500*1000+400*100+200*100+50*50");
|
|
8
|
-
expect((0, _mathConverter.mathConverter)("1350*1350")).toBe("1700*1000+600*100+400*100+200*100+50*50");
|
|
9
|
-
expect((0, _mathConverter.mathConverter)("1550*1550")).toBe("2100*1000+1000*100+800*100+600*100+400*100+200*100+50*50");
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// Test exponentiation conversion
|
|
13
|
-
test("should convert exponentiation", function () {
|
|
14
|
-
expect((0, _mathConverter.mathConverter)("1250^2")).toBe("1500*1000+400*100+200*100+50*50");
|
|
15
|
-
expect((0, _mathConverter.mathConverter)("1350^2")).toBe("1700*1000+600*100+400*100+200*100+50*50");
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// Test cases where no conversion is needed
|
|
19
|
-
test("should not convert when unnecessary", function () {
|
|
20
|
-
expect((0, _mathConverter.mathConverter)("1250")).toBe("1250");
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// Test cases with multiple operands
|
|
24
|
-
test("should handle multiple operands", function () {
|
|
25
|
-
expect((0, _mathConverter.mathConverter)("1250+1250")).toBe("1250+1250");
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// Test invalid inputs
|
|
29
|
-
test("should handle invalid input", function () {
|
|
30
|
-
expect((0, _mathConverter.mathConverter)("abc")).toBe("abc");
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// Test when primary value is missing
|
|
34
|
-
test("should handle missing primary value", function () {
|
|
35
|
-
expect((0, _mathConverter.mathConverter)("0*0")).toBe("0*0");
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|