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,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _padStart = require("@/String/padStart");
|
|
4
|
-
describe("padStart", function () {
|
|
5
|
-
describe("basic functionality", function () {
|
|
6
|
-
it("should pad the start of string with specified character", function () {
|
|
7
|
-
expect((0, _padStart.padStart)("abc", 5, " ")).toBe(" abc");
|
|
8
|
-
expect((0, _padStart.padStart)("abc", 5, "0")).toBe("00abc");
|
|
9
|
-
});
|
|
10
|
-
it("should return original string if already at or exceeding target length", function () {
|
|
11
|
-
expect((0, _padStart.padStart)("abc", 2, " ")).toBe("abc"); // Shorter target
|
|
12
|
-
expect((0, _padStart.padStart)("abc", 3, " ")).toBe("abc"); // Equal length
|
|
13
|
-
expect((0, _padStart.padStart)("abc", 0, " ")).toBe("abc"); // Zero target
|
|
14
|
-
});
|
|
15
|
-
it("should handle empty string input", function () {
|
|
16
|
-
expect((0, _padStart.padStart)("", 3, "0")).toBe("000");
|
|
17
|
-
expect((0, _padStart.padStart)("", 4, "x")).toBe("xxxx");
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
describe("multi-character padding", function () {
|
|
21
|
-
it("should repeat padding string to reach target length", function () {
|
|
22
|
-
expect((0, _padStart.padStart)("abc", 7, "xy")).toBe("xyxyabc");
|
|
23
|
-
expect((0, _padStart.padStart)("abc", 8, "123")).toBe("12312abc");
|
|
24
|
-
});
|
|
25
|
-
it("should truncate padding string if needed", function () {
|
|
26
|
-
expect((0, _padStart.padStart)("abc", 6, "12345")).toBe("123abc");
|
|
27
|
-
expect((0, _padStart.padStart)("abc", 5, "0000")).toBe("00abc");
|
|
28
|
-
});
|
|
29
|
-
it("should work with single-character padding string", function () {
|
|
30
|
-
expect((0, _padStart.padStart)("abc", 5, "x")).toBe("xxabc");
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
describe("error handling", function () {
|
|
34
|
-
it("should throw error on empty padding string", function () {
|
|
35
|
-
expect(function () {
|
|
36
|
-
return (0, _padStart.padStart)("abc", 5, "");
|
|
37
|
-
}).toThrow("padString cannot be empty");
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _randomString = require("@/String/randomString");
|
|
4
|
-
describe("randomString", function () {
|
|
5
|
-
it("should generate random string with default characters and length", function () {
|
|
6
|
-
var str = (0, _randomString.randomString)();
|
|
7
|
-
expect(str).toHaveLength(8);
|
|
8
|
-
expect(str).toMatch(/^[0-9A-Za-z]{8}$/);
|
|
9
|
-
});
|
|
10
|
-
it("should generate random string using custom character set", function () {
|
|
11
|
-
var chars = "abc123";
|
|
12
|
-
var str = (0, _randomString.randomString)(10, chars);
|
|
13
|
-
expect(str).toHaveLength(10);
|
|
14
|
-
expect(str).toMatch(/^[abc123]{10}$/);
|
|
15
|
-
});
|
|
16
|
-
it("should generate random string with specified length", function () {
|
|
17
|
-
var size = 20;
|
|
18
|
-
var str = (0, _randomString.randomString)(size, undefined);
|
|
19
|
-
expect(str).toHaveLength(size);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _randomStringInitialization = require("@/String/randomStringInitialization");
|
|
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("randomStringInitialization", function () {
|
|
11
|
-
it("should generate random strings with default character set", function () {
|
|
12
|
-
var randomStringFunc = (0, _randomStringInitialization.randomStringInitialization)();
|
|
13
|
-
var result = randomStringFunc(10);
|
|
14
|
-
expect(result).toHaveLength(10);
|
|
15
|
-
});
|
|
16
|
-
it("should generate random strings with custom character set", function () {
|
|
17
|
-
var customCharSet = "ABC123";
|
|
18
|
-
var randomStringFunc = (0, _randomStringInitialization.randomStringInitialization)(customCharSet);
|
|
19
|
-
var result = randomStringFunc(5);
|
|
20
|
-
expect(result).toHaveLength(5);
|
|
21
|
-
expect(_toConsumableArray(result).every(function (_char) {
|
|
22
|
-
return customCharSet.includes(_char);
|
|
23
|
-
})).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _reverseString = require("@/String/reverseString");
|
|
4
|
-
describe("reverseString", function () {
|
|
5
|
-
test("should reverse a three-character string", function () {
|
|
6
|
-
expect((0, _reverseString.reverseString)("abc")).toBe("cba");
|
|
7
|
-
});
|
|
8
|
-
test("should handle empty string", function () {
|
|
9
|
-
expect((0, _reverseString.reverseString)("")).toBe("");
|
|
10
|
-
});
|
|
11
|
-
test("should handle single character", function () {
|
|
12
|
-
expect((0, _reverseString.reverseString)("a")).toBe("a");
|
|
13
|
-
});
|
|
14
|
-
test("should reverse a two-character string", function () {
|
|
15
|
-
expect((0, _reverseString.reverseString)("ab")).toBe("ba");
|
|
16
|
-
});
|
|
17
|
-
test("should reverse a three-character string (second test)", function () {
|
|
18
|
-
expect((0, _reverseString.reverseString)("abc")).toBe("cba");
|
|
19
|
-
});
|
|
20
|
-
test("should reverse a four-character string", function () {
|
|
21
|
-
expect((0, _reverseString.reverseString)("abcd")).toBe("dcba");
|
|
22
|
-
});
|
|
23
|
-
test("should reverse a five-character string", function () {
|
|
24
|
-
expect((0, _reverseString.reverseString)("abcde")).toBe("edcba");
|
|
25
|
-
});
|
|
26
|
-
test("should reverse a six-character string", function () {
|
|
27
|
-
expect((0, _reverseString.reverseString)("abcdef")).toBe("fedcba");
|
|
28
|
-
});
|
|
29
|
-
test("should reverse a seven-character string", function () {
|
|
30
|
-
expect((0, _reverseString.reverseString)("abcdefg")).toBe("gfedcba");
|
|
31
|
-
});
|
|
32
|
-
test("should reverse an eight-character string", function () {
|
|
33
|
-
expect((0, _reverseString.reverseString)("abcdefgh")).toBe("hgfedcba");
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _toBase = require("@/String/toBase64");
|
|
4
|
-
describe("toBase64", function () {
|
|
5
|
-
it("should convert normal string to Base64", function () {
|
|
6
|
-
expect((0, _toBase.toBase64)("test")).toBe("dGVzdA==");
|
|
7
|
-
});
|
|
8
|
-
it("should convert empty string to Base64", function () {
|
|
9
|
-
expect((0, _toBase.toBase64)("")).toBe("");
|
|
10
|
-
});
|
|
11
|
-
it("should convert string with special characters to Base64", function () {
|
|
12
|
-
expect((0, _toBase.toBase64)("@#%")).toBe("QCMl");
|
|
13
|
-
});
|
|
14
|
-
it("should convert string with Japanese characters to Base64", function () {
|
|
15
|
-
expect((0, _toBase.toBase64)("あいうえお")).toBe("44GC44GE44GG44GI44GK");
|
|
16
|
-
});
|
|
17
|
-
it("should convert long string to Base64", function () {
|
|
18
|
-
expect((0, _toBase.toBase64)("This is a long string to test the Base64 conversion")).toBe("VGhpcyBpcyBhIGxvbmcgc3RyaW5nIHRvIHRlc3QgdGhlIEJhc2U2NCBjb252ZXJzaW9u");
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _toHalfWidth = require("@/String/toHalfWidth");
|
|
4
|
-
describe("toHalfWidth", function () {
|
|
5
|
-
it("should convert full-width alphanumeric characters to half-width", function () {
|
|
6
|
-
expect((0, _toHalfWidth.toHalfWidth)("0123456789")).toBe("0123456789");
|
|
7
|
-
expect((0, _toHalfWidth.toHalfWidth)("ABCDEFGHIJ")).toBe("ABCDEFGHIJ");
|
|
8
|
-
expect((0, _toHalfWidth.toHalfWidth)("abcdefghij")).toBe("abcdefghij");
|
|
9
|
-
});
|
|
10
|
-
it("should correctly convert strings containing both full-width and half-width characters", function () {
|
|
11
|
-
expect((0, _toHalfWidth.toHalfWidth)("ABCabc123123")).toBe("ABCabc123123");
|
|
12
|
-
});
|
|
13
|
-
it("should keep non-target characters unchanged", function () {
|
|
14
|
-
expect((0, _toHalfWidth.toHalfWidth)("漢字カタカナ、。")).toBe("漢字カタカナ、。");
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _trimCharacters = require("@/String/trimCharacters");
|
|
4
|
-
describe("trimCharacters", function () {
|
|
5
|
-
it("should remove specified characters from both ends of string", function () {
|
|
6
|
-
expect((0, _trimCharacters.trimCharacters)("---Hello World---", "-")).toBe("Hello World");
|
|
7
|
-
});
|
|
8
|
-
it("should not remove specified characters from middle of string", function () {
|
|
9
|
-
expect((0, _trimCharacters.trimCharacters)("---Hello-World---", "-")).toBe("Hello-World");
|
|
10
|
-
});
|
|
11
|
-
it("should return empty string when input is empty", function () {
|
|
12
|
-
expect((0, _trimCharacters.trimCharacters)("", "-")).toBe("");
|
|
13
|
-
});
|
|
14
|
-
it("should return original string when no characters are specified to remove", function () {
|
|
15
|
-
expect((0, _trimCharacters.trimCharacters)("Hello World", "")).toBe("Hello World");
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _trimEndCharacters = require("@/String/trimEndCharacters");
|
|
4
|
-
describe("trimEndCharacters", function () {
|
|
5
|
-
it("should remove specified characters from the end of string", function () {
|
|
6
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("hellooo", "o")).toBe("hell");
|
|
7
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("banana!!!", "!")).toBe("banana");
|
|
8
|
-
});
|
|
9
|
-
it("should handle multiple different characters to trim", function () {
|
|
10
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("hello123...", "123.")).toBe("hello");
|
|
11
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("test---...", ".-")).toBe("test");
|
|
12
|
-
});
|
|
13
|
-
it("should return original string if no characters match", function () {
|
|
14
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("apple", "x")).toBe("apple");
|
|
15
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("test", "xyz")).toBe("test");
|
|
16
|
-
});
|
|
17
|
-
it("should handle empty input string", function () {
|
|
18
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("", "x")).toBe("");
|
|
19
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("", "")).toBe("");
|
|
20
|
-
});
|
|
21
|
-
it("should return empty string if all characters are trimmed", function () {
|
|
22
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("xxxxx", "x")).toBe("");
|
|
23
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("....", ".")).toBe("");
|
|
24
|
-
});
|
|
25
|
-
it("should return original string if trim characters is empty", function () {
|
|
26
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("hello", "")).toBe("hello");
|
|
27
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("test123", "")).toBe("test123");
|
|
28
|
-
});
|
|
29
|
-
it("should handle non-ascii characters", function () {
|
|
30
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("こんにちは。。。", "。")).toBe("こんにちは");
|
|
31
|
-
expect((0, _trimEndCharacters.trimEndCharacters)("Hello!!", "!")).toBe("Hello");
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _trimStartCharacters = require("@/String/trimStartCharacters");
|
|
4
|
-
describe("trimStartCharacters", function () {
|
|
5
|
-
it("should remove specified characters from the start of string", function () {
|
|
6
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("---Hello", "-")).toBe("Hello");
|
|
7
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("!!!world", "!")).toBe("world");
|
|
8
|
-
});
|
|
9
|
-
it("should handle multiple different characters to trim", function () {
|
|
10
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("...123test", ".123")).toBe("test");
|
|
11
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("---...text", ".-")).toBe("text");
|
|
12
|
-
});
|
|
13
|
-
it("should return original string if no characters match", function () {
|
|
14
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("hello", "x")).toBe("hello");
|
|
15
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("test", "xyz")).toBe("test");
|
|
16
|
-
});
|
|
17
|
-
it("should handle empty input string", function () {
|
|
18
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("", "x")).toBe("");
|
|
19
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("", "")).toBe("");
|
|
20
|
-
});
|
|
21
|
-
it("should return empty string if all characters are trimmed", function () {
|
|
22
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("xxxxx", "x")).toBe("");
|
|
23
|
-
expect((0, _trimStartCharacters.trimStartCharacters)(".....", ".")).toBe("");
|
|
24
|
-
});
|
|
25
|
-
it("should return original string if trim characters is empty", function () {
|
|
26
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("hello", "")).toBe("hello");
|
|
27
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("123test", "")).toBe("123test");
|
|
28
|
-
});
|
|
29
|
-
it("should handle non-ascii characters", function () {
|
|
30
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("。。。こんにちは", "。")).toBe("こんにちは");
|
|
31
|
-
expect((0, _trimStartCharacters.trimStartCharacters)("!!Hello", "!")).toBe("Hello");
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _convertTime = require("@/Time/convertTime");
|
|
4
|
-
describe("convertTime", function () {
|
|
5
|
-
// long format to long format
|
|
6
|
-
test("converts 1 hour to seconds", function () {
|
|
7
|
-
expect((0, _convertTime.convertTime)("1", "hours", "seconds")).toBe(3600);
|
|
8
|
-
expect((0, _convertTime.convertTime)(1, "hours", "seconds")).toBe(3600);
|
|
9
|
-
});
|
|
10
|
-
test("converts 3600 seconds to hours", function () {
|
|
11
|
-
expect((0, _convertTime.convertTime)("3600", "seconds", "hours")).toBe(1);
|
|
12
|
-
});
|
|
13
|
-
test("converts 90 minutes to hours", function () {
|
|
14
|
-
expect((0, _convertTime.convertTime)("90", "minutes", "hours")).toBe(1.5);
|
|
15
|
-
});
|
|
16
|
-
test("converts 1 hour to milliseconds", function () {
|
|
17
|
-
expect((0, _convertTime.convertTime)("1", "hours", "milliseconds")).toBe(3600000);
|
|
18
|
-
});
|
|
19
|
-
test("converts 0.5 seconds to milliseconds", function () {
|
|
20
|
-
expect((0, _convertTime.convertTime)("0.5", "seconds", "milliseconds")).toBe(500);
|
|
21
|
-
});
|
|
22
|
-
test("converts 1000 milliseconds to seconds", function () {
|
|
23
|
-
expect((0, _convertTime.convertTime)("1000", "milliseconds", "seconds")).toBe(1);
|
|
24
|
-
});
|
|
25
|
-
test("converts between same units (seconds to seconds)", function () {
|
|
26
|
-
expect((0, _convertTime.convertTime)("10", "seconds", "seconds")).toBe(10);
|
|
27
|
-
});
|
|
28
|
-
test("converts decimal input (1.5 hours to minutes)", function () {
|
|
29
|
-
expect((0, _convertTime.convertTime)("1.5", "hours", "minutes")).toBe(90);
|
|
30
|
-
});
|
|
31
|
-
test("converts zero", function () {
|
|
32
|
-
expect((0, _convertTime.convertTime)("0", "hours", "seconds")).toBe(0);
|
|
33
|
-
});
|
|
34
|
-
test("converts very large numbers", function () {
|
|
35
|
-
expect((0, _convertTime.convertTime)("1e9", "milliseconds", "hours")).toBe(1000000000 / (60 * 60 * 1000));
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// short format to short format
|
|
39
|
-
test("converts 1 hour to seconds (short format)", function () {
|
|
40
|
-
expect((0, _convertTime.convertTime)("1", "h", "s")).toBe(3600);
|
|
41
|
-
});
|
|
42
|
-
test("converts 3600 seconds to hours (short format)", function () {
|
|
43
|
-
expect((0, _convertTime.convertTime)("3600", "s", "h")).toBe(1);
|
|
44
|
-
});
|
|
45
|
-
test("converts 90 minutes to hours (short format)", function () {
|
|
46
|
-
expect((0, _convertTime.convertTime)("90", "m", "h")).toBe(1.5);
|
|
47
|
-
});
|
|
48
|
-
test("converts 1 hour to milliseconds (short format)", function () {
|
|
49
|
-
expect((0, _convertTime.convertTime)("1", "h", "ms")).toBe(3600000);
|
|
50
|
-
});
|
|
51
|
-
test("converts 0.5 seconds to milliseconds (short format)", function () {
|
|
52
|
-
expect((0, _convertTime.convertTime)("0.5", "s", "ms")).toBe(500);
|
|
53
|
-
});
|
|
54
|
-
test("converts 1000 milliseconds to seconds (short format)", function () {
|
|
55
|
-
expect((0, _convertTime.convertTime)("1000", "ms", "s")).toBe(1);
|
|
56
|
-
});
|
|
57
|
-
test("converts between same units (seconds to seconds) (short format)", function () {
|
|
58
|
-
expect((0, _convertTime.convertTime)("10", "s", "s")).toBe(10);
|
|
59
|
-
});
|
|
60
|
-
test("converts decimal input (1.5 hours to minutes) (short format)", function () {
|
|
61
|
-
expect((0, _convertTime.convertTime)("1.5", "h", "m")).toBe(90);
|
|
62
|
-
});
|
|
63
|
-
test("converts zero (short format)", function () {
|
|
64
|
-
expect((0, _convertTime.convertTime)("0", "h", "s")).toBe(0);
|
|
65
|
-
});
|
|
66
|
-
test("converts very large numbers (short format)", function () {
|
|
67
|
-
expect((0, _convertTime.convertTime)("1e9", "ms", "h")).toBe(1000000000 / (60 * 60 * 1000));
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
// long format to short format
|
|
71
|
-
|
|
72
|
-
test("converts 1 hour to seconds (long to short)", function () {
|
|
73
|
-
expect((0, _convertTime.convertTime)("1", "hours", "s")).toBe(3600);
|
|
74
|
-
});
|
|
75
|
-
test("converts 3600 seconds to hours (long to short)", function () {
|
|
76
|
-
expect((0, _convertTime.convertTime)("3600", "seconds", "h")).toBe(1);
|
|
77
|
-
});
|
|
78
|
-
test("converts 90 minutes to hours (long to short)", function () {
|
|
79
|
-
expect((0, _convertTime.convertTime)("90", "minutes", "h")).toBe(1.5);
|
|
80
|
-
});
|
|
81
|
-
test("converts 1 hour to milliseconds (long to short)", function () {
|
|
82
|
-
expect((0, _convertTime.convertTime)("1", "hours", "ms")).toBe(3600000);
|
|
83
|
-
});
|
|
84
|
-
test("converts 0.5 seconds to milliseconds (long to short)", function () {
|
|
85
|
-
expect((0, _convertTime.convertTime)("0.5", "seconds", "ms")).toBe(500);
|
|
86
|
-
});
|
|
87
|
-
test("converts 1000 milliseconds to seconds (long to short)", function () {
|
|
88
|
-
expect((0, _convertTime.convertTime)("1000", "milliseconds", "s")).toBe(1);
|
|
89
|
-
});
|
|
90
|
-
test("converts between same units (seconds to seconds) (long to short)", function () {
|
|
91
|
-
expect((0, _convertTime.convertTime)("10", "seconds", "s")).toBe(10);
|
|
92
|
-
});
|
|
93
|
-
test("converts decimal input (1.5 hours to minutes) (long to short)", function () {
|
|
94
|
-
expect((0, _convertTime.convertTime)("1.5", "hours", "m")).toBe(90);
|
|
95
|
-
});
|
|
96
|
-
test("converts zero (long to short)", function () {
|
|
97
|
-
expect((0, _convertTime.convertTime)("0", "hours", "s")).toBe(0);
|
|
98
|
-
});
|
|
99
|
-
test("converts very large numbers (long to short)", function () {
|
|
100
|
-
expect((0, _convertTime.convertTime)("1e9", "milliseconds", "h")).toBe(1000000000 / (60 * 60 * 1000));
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
// short format to long format
|
|
104
|
-
|
|
105
|
-
test("converts 1 hour to seconds (short to long)", function () {
|
|
106
|
-
expect((0, _convertTime.convertTime)("1", "h", "seconds")).toBe(3600);
|
|
107
|
-
});
|
|
108
|
-
test("converts 3600 seconds to hours (short to long)", function () {
|
|
109
|
-
expect((0, _convertTime.convertTime)("3600", "s", "hours")).toBe(1);
|
|
110
|
-
});
|
|
111
|
-
test("converts 90 minutes to hours (short to long)", function () {
|
|
112
|
-
expect((0, _convertTime.convertTime)("90", "m", "hours")).toBe(1.5);
|
|
113
|
-
});
|
|
114
|
-
test("converts 1 hour to milliseconds (short to long)", function () {
|
|
115
|
-
expect((0, _convertTime.convertTime)("1", "h", "milliseconds")).toBe(3600000);
|
|
116
|
-
});
|
|
117
|
-
test("converts 0.5 seconds to milliseconds (short to long)", function () {
|
|
118
|
-
expect((0, _convertTime.convertTime)("0.5", "s", "milliseconds")).toBe(500);
|
|
119
|
-
});
|
|
120
|
-
test("converts 1000 milliseconds to seconds (short to long)", function () {
|
|
121
|
-
expect((0, _convertTime.convertTime)("1000", "ms", "seconds")).toBe(1);
|
|
122
|
-
});
|
|
123
|
-
test("converts between same units (seconds to seconds) (short to long)", function () {
|
|
124
|
-
expect((0, _convertTime.convertTime)("10", "s", "seconds")).toBe(10);
|
|
125
|
-
});
|
|
126
|
-
test("converts decimal input (1.5 hours to minutes) (short to long)", function () {
|
|
127
|
-
expect((0, _convertTime.convertTime)("1.5", "h", "minutes")).toBe(90);
|
|
128
|
-
});
|
|
129
|
-
test("converts zero (short to long)", function () {
|
|
130
|
-
expect((0, _convertTime.convertTime)("0", "h", "seconds")).toBe(0);
|
|
131
|
-
});
|
|
132
|
-
test("converts very large numbers (short to long)", function () {
|
|
133
|
-
expect((0, _convertTime.convertTime)("1e9", "ms", "hours")).toBe(1000000000 / (60 * 60 * 1000));
|
|
134
|
-
});
|
|
135
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _normalizeTimeUnit = require("@/Time/normalizeTimeUnit");
|
|
4
|
-
describe("normalizeTimeUnit", function () {
|
|
5
|
-
test("converts long format to long format", function () {
|
|
6
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("milliseconds", "long")).toBe("milliseconds");
|
|
7
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("seconds", "long")).toBe("seconds");
|
|
8
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("minutes", "long")).toBe("minutes");
|
|
9
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("hours", "long")).toBe("hours");
|
|
10
|
-
});
|
|
11
|
-
test("converts long format to short format", function () {
|
|
12
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("milliseconds", "short")).toBe("ms");
|
|
13
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("seconds", "short")).toBe("s");
|
|
14
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("minutes", "short")).toBe("m");
|
|
15
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("hours", "short")).toBe("h");
|
|
16
|
-
});
|
|
17
|
-
test("converts short format to long format", function () {
|
|
18
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("ms", "long")).toBe("milliseconds");
|
|
19
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("s", "long")).toBe("seconds");
|
|
20
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("m", "long")).toBe("minutes");
|
|
21
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("h", "long")).toBe("hours");
|
|
22
|
-
});
|
|
23
|
-
test("converts short format to short format", function () {
|
|
24
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("ms", "short")).toBe("ms");
|
|
25
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("s", "short")).toBe("s");
|
|
26
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("m", "short")).toBe("m");
|
|
27
|
-
expect((0, _normalizeTimeUnit.normalizeTimeUnit)("h", "short")).toBe("h");
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var _createPipeline = require("@/Tool/createPipeline");
|
|
5
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
11
|
-
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."); }
|
|
12
|
-
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; } }
|
|
13
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
14
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
15
|
-
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; }
|
|
16
|
-
describe("createPipeline", function () {
|
|
17
|
-
it("returns initial value when called without arguments", function () {
|
|
18
|
-
var pipeline = (0, _createPipeline.createPipeline)(1);
|
|
19
|
-
expect(pipeline()).toBe(1);
|
|
20
|
-
});
|
|
21
|
-
it("returns a new Pipeline instance when passing a function as argument", function () {
|
|
22
|
-
var pipeline = (0, _createPipeline.createPipeline)(1);
|
|
23
|
-
var newPipeline = pipeline(function (x) {
|
|
24
|
-
return x + 1;
|
|
25
|
-
});
|
|
26
|
-
expect(newPipeline).toBeInstanceOf(Function);
|
|
27
|
-
});
|
|
28
|
-
it("returns transformed value when called with a function argument", function () {
|
|
29
|
-
var pipeline = (0, _createPipeline.createPipeline)(1);
|
|
30
|
-
var newPipeline = pipeline(function (x) {
|
|
31
|
-
return x + 1;
|
|
32
|
-
});
|
|
33
|
-
expect(newPipeline()).toBe(2);
|
|
34
|
-
});
|
|
35
|
-
it("can chain multiple function calls", function () {
|
|
36
|
-
var pipeline = (0, _createPipeline.createPipeline)(1);
|
|
37
|
-
var result = pipeline(function (x) {
|
|
38
|
-
return x + 1;
|
|
39
|
-
})(function (x) {
|
|
40
|
-
return x * 2;
|
|
41
|
-
})(function (x) {
|
|
42
|
-
return x - 1;
|
|
43
|
-
})();
|
|
44
|
-
expect(result).toBe(3);
|
|
45
|
-
});
|
|
46
|
-
it("correctly infers function types", function () {
|
|
47
|
-
var pipeline = (0, _createPipeline.createPipeline)(1);
|
|
48
|
-
var newPipeline = pipeline(function (x) {
|
|
49
|
-
return "".concat(x);
|
|
50
|
-
});
|
|
51
|
-
var result = newPipeline();
|
|
52
|
-
expect(result).toBe("1");
|
|
53
|
-
});
|
|
54
|
-
it("correctly handles complex type inference", function () {
|
|
55
|
-
var user = {
|
|
56
|
-
id: 1,
|
|
57
|
-
name: "John Doe",
|
|
58
|
-
age: 30
|
|
59
|
-
};
|
|
60
|
-
var pipeline = (0, _createPipeline.createPipeline)(user);
|
|
61
|
-
var post = pipeline(function (user) {
|
|
62
|
-
return {
|
|
63
|
-
id: 1,
|
|
64
|
-
title: "First Post",
|
|
65
|
-
content: "Hello, world!",
|
|
66
|
-
author: user
|
|
67
|
-
};
|
|
68
|
-
})();
|
|
69
|
-
expect(post).toEqual({
|
|
70
|
-
id: 1,
|
|
71
|
-
title: "First Post",
|
|
72
|
-
content: "Hello, world!",
|
|
73
|
-
author: {
|
|
74
|
-
id: 1,
|
|
75
|
-
name: "John Doe",
|
|
76
|
-
age: 30
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
it("correctly infers nested generic types", function () {
|
|
81
|
-
var pipeline = (0, _createPipeline.createPipeline)([]);
|
|
82
|
-
var users = pipeline(function (users) {
|
|
83
|
-
return [].concat(_toConsumableArray(users), [{
|
|
84
|
-
id: 1,
|
|
85
|
-
name: "John Doe",
|
|
86
|
-
age: 30
|
|
87
|
-
}]);
|
|
88
|
-
})(function (users) {
|
|
89
|
-
return [].concat(_toConsumableArray(users), [{
|
|
90
|
-
id: 2,
|
|
91
|
-
name: "Jane Smith",
|
|
92
|
-
age: 25
|
|
93
|
-
}]);
|
|
94
|
-
})();
|
|
95
|
-
expect(users).toEqual([{
|
|
96
|
-
id: 1,
|
|
97
|
-
name: "John Doe",
|
|
98
|
-
age: 30
|
|
99
|
-
}, {
|
|
100
|
-
id: 2,
|
|
101
|
-
name: "Jane Smith",
|
|
102
|
-
age: 25
|
|
103
|
-
}]);
|
|
104
|
-
});
|
|
105
|
-
it("works correctly with null as initial value", function () {
|
|
106
|
-
var pipeline = (0, _createPipeline.createPipeline)(null);
|
|
107
|
-
expect(pipeline()).toBeNull();
|
|
108
|
-
});
|
|
109
|
-
it("works correctly with undefined as initial value", function () {
|
|
110
|
-
var pipeline = (0, _createPipeline.createPipeline)(undefined);
|
|
111
|
-
expect(pipeline()).toBeUndefined();
|
|
112
|
-
});
|
|
113
|
-
it("can process empty strings correctly", function () {
|
|
114
|
-
var pipeline = (0, _createPipeline.createPipeline)("");
|
|
115
|
-
var result = pipeline(function (x) {
|
|
116
|
-
return x + "test";
|
|
117
|
-
})(function (x) {
|
|
118
|
-
return x.toUpperCase();
|
|
119
|
-
})();
|
|
120
|
-
expect(result).toBe("TEST");
|
|
121
|
-
});
|
|
122
|
-
it("can process numeric zero correctly", function () {
|
|
123
|
-
var pipeline = (0, _createPipeline.createPipeline)(0);
|
|
124
|
-
var result = pipeline(function (x) {
|
|
125
|
-
return x + 1;
|
|
126
|
-
})(function (x) {
|
|
127
|
-
return x * 2;
|
|
128
|
-
})();
|
|
129
|
-
expect(result).toBe(2);
|
|
130
|
-
});
|
|
131
|
-
it("can process boolean transformations correctly", function () {
|
|
132
|
-
var pipeline = (0, _createPipeline.createPipeline)(true);
|
|
133
|
-
var result = pipeline(function (x) {
|
|
134
|
-
return !x;
|
|
135
|
-
})(function (x) {
|
|
136
|
-
return x.toString();
|
|
137
|
-
})();
|
|
138
|
-
expect(result).toBe("false");
|
|
139
|
-
});
|
|
140
|
-
it("can process array transformations correctly", function () {
|
|
141
|
-
var pipeline = (0, _createPipeline.createPipeline)([1, 2, 3, 4, 5]);
|
|
142
|
-
var result = pipeline(function (arr) {
|
|
143
|
-
return arr.filter(function (x) {
|
|
144
|
-
return x % 2 === 0;
|
|
145
|
-
});
|
|
146
|
-
})(function (arr) {
|
|
147
|
-
return arr.map(function (x) {
|
|
148
|
-
return x * 2;
|
|
149
|
-
});
|
|
150
|
-
})();
|
|
151
|
-
expect(result).toEqual([4, 8]);
|
|
152
|
-
});
|
|
153
|
-
it("can process complex object transformations correctly", function () {
|
|
154
|
-
var initial = {
|
|
155
|
-
count: 0,
|
|
156
|
-
items: []
|
|
157
|
-
};
|
|
158
|
-
var pipeline = (0, _createPipeline.createPipeline)(initial);
|
|
159
|
-
var result = pipeline(function (data) {
|
|
160
|
-
return _objectSpread(_objectSpread({}, data), {}, {
|
|
161
|
-
count: data.count + 1
|
|
162
|
-
});
|
|
163
|
-
})(function (data) {
|
|
164
|
-
return _objectSpread(_objectSpread({}, data), {}, {
|
|
165
|
-
items: [].concat(_toConsumableArray(data.items), ["Item ".concat(data.count)])
|
|
166
|
-
});
|
|
167
|
-
})();
|
|
168
|
-
expect(result).toEqual({
|
|
169
|
-
count: 1,
|
|
170
|
-
items: ["Item 1"]
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
it("can process multiple type transformations in chain", function () {
|
|
174
|
-
var pipeline = (0, _createPipeline.createPipeline)(123);
|
|
175
|
-
var result = pipeline(function (x) {
|
|
176
|
-
return x.toString();
|
|
177
|
-
})(function (x) {
|
|
178
|
-
return x.split("");
|
|
179
|
-
})(function (arr) {
|
|
180
|
-
return arr.map(Number);
|
|
181
|
-
})();
|
|
182
|
-
expect(result).toEqual([1, 2, 3]);
|
|
183
|
-
});
|
|
184
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|