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
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ultraNumberSort = void 0;
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
8
|
+
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; } }
|
|
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
|
+
/**
|
|
11
|
+
* Ultra-fast sorting specifically optimized for number arrays
|
|
12
|
+
* @param array Array of numbers to sort
|
|
13
|
+
* @param ascending Sort in ascending order if true, descending if false
|
|
14
|
+
* @returns Sorted array
|
|
15
|
+
*/
|
|
16
|
+
var ultraNumberSort = exports.ultraNumberSort = function ultraNumberSort(array) {
|
|
17
|
+
var ascending = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
18
|
+
var length = array.length;
|
|
19
|
+
if (length <= 1) {
|
|
20
|
+
return array;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// For tiny arrays, use optimized inline sort
|
|
24
|
+
if (length === 2) {
|
|
25
|
+
if (array[0] > array[1] === ascending) {
|
|
26
|
+
var _ref = [array[1], array[0]];
|
|
27
|
+
array[0] = _ref[0];
|
|
28
|
+
array[1] = _ref[1];
|
|
29
|
+
}
|
|
30
|
+
return array;
|
|
31
|
+
}
|
|
32
|
+
if (length === 3) {
|
|
33
|
+
inlineSort3(array, ascending);
|
|
34
|
+
return array;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Check if all numbers are integers and find range
|
|
38
|
+
var allIntegers = true;
|
|
39
|
+
var min = array[0];
|
|
40
|
+
var max = array[0];
|
|
41
|
+
var hasNaN = false;
|
|
42
|
+
for (var index = 0; index < length; index++) {
|
|
43
|
+
var value = array[index];
|
|
44
|
+
// biome-ignore lint/suspicious/noSelfCompare: <explanation>
|
|
45
|
+
if (value !== value) {
|
|
46
|
+
hasNaN = true;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
if (value < min) {
|
|
50
|
+
min = value;
|
|
51
|
+
}
|
|
52
|
+
if (value > max) {
|
|
53
|
+
max = value;
|
|
54
|
+
}
|
|
55
|
+
if (allIntegers && value !== Math.floor(value)) {
|
|
56
|
+
allIntegers = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Handle NaN values
|
|
61
|
+
if (hasNaN) {
|
|
62
|
+
return handleNaNSort(array, ascending);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// For small integer ranges, use counting sort
|
|
66
|
+
if (allIntegers && max - min < length * 2 && max - min < 1000000) {
|
|
67
|
+
return countingSort(array, min, max, ascending);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// For larger arrays, use radix sort if applicable
|
|
71
|
+
if (allIntegers && length > 100) {
|
|
72
|
+
return radixSort(array, ascending);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Fall back to optimized quicksort for floating point
|
|
76
|
+
return numericQuickSort(array, 0, length - 1, ascending);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Inline sort for 3 elements
|
|
81
|
+
*/
|
|
82
|
+
var inlineSort3 = function inlineSort3(array, ascending) {
|
|
83
|
+
var a = array[0];
|
|
84
|
+
var b = array[1];
|
|
85
|
+
var c = array[2];
|
|
86
|
+
if (ascending) {
|
|
87
|
+
if (a > b) {
|
|
88
|
+
var _ref2 = [b, a];
|
|
89
|
+
a = _ref2[0];
|
|
90
|
+
b = _ref2[1];
|
|
91
|
+
}
|
|
92
|
+
if (b > c) {
|
|
93
|
+
var _ref3 = [c, b];
|
|
94
|
+
b = _ref3[0];
|
|
95
|
+
c = _ref3[1];
|
|
96
|
+
if (a > b) {
|
|
97
|
+
var _ref4 = [b, a];
|
|
98
|
+
a = _ref4[0];
|
|
99
|
+
b = _ref4[1];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
if (a < b) {
|
|
104
|
+
var _ref5 = [b, a];
|
|
105
|
+
a = _ref5[0];
|
|
106
|
+
b = _ref5[1];
|
|
107
|
+
}
|
|
108
|
+
if (b < c) {
|
|
109
|
+
var _ref6 = [c, b];
|
|
110
|
+
b = _ref6[0];
|
|
111
|
+
c = _ref6[1];
|
|
112
|
+
if (a < b) {
|
|
113
|
+
var _ref7 = [b, a];
|
|
114
|
+
a = _ref7[0];
|
|
115
|
+
b = _ref7[1];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
array[0] = a;
|
|
120
|
+
array[1] = b;
|
|
121
|
+
array[2] = c;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Handle arrays with NaN values
|
|
126
|
+
*/
|
|
127
|
+
var handleNaNSort = function handleNaNSort(array, ascending) {
|
|
128
|
+
var valid = [];
|
|
129
|
+
var nanCount = 0;
|
|
130
|
+
var _iterator = _createForOfIteratorHelper(array),
|
|
131
|
+
_step;
|
|
132
|
+
try {
|
|
133
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
134
|
+
var element = _step.value;
|
|
135
|
+
// biome-ignore lint/suspicious/noSelfCompare: <explanation>
|
|
136
|
+
if (element === element) {
|
|
137
|
+
valid.push(element);
|
|
138
|
+
} else {
|
|
139
|
+
nanCount++;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
} catch (err) {
|
|
143
|
+
_iterator.e(err);
|
|
144
|
+
} finally {
|
|
145
|
+
_iterator.f();
|
|
146
|
+
}
|
|
147
|
+
numericQuickSort(valid, 0, valid.length - 1, ascending);
|
|
148
|
+
|
|
149
|
+
// NaN values go to the end
|
|
150
|
+
for (var index = 0; index < nanCount; index++) {
|
|
151
|
+
valid.push(Number.NaN);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Copy back
|
|
155
|
+
for (var _index = 0; _index < array.length; _index++) {
|
|
156
|
+
array[_index] = valid[_index];
|
|
157
|
+
}
|
|
158
|
+
return array;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Counting sort for small integer ranges
|
|
163
|
+
*/
|
|
164
|
+
var countingSort = function countingSort(array, min, max, ascending) {
|
|
165
|
+
var range = max - min + 1;
|
|
166
|
+
var count = new Uint32Array(range);
|
|
167
|
+
|
|
168
|
+
// Count occurrences
|
|
169
|
+
var _iterator2 = _createForOfIteratorHelper(array),
|
|
170
|
+
_step2;
|
|
171
|
+
try {
|
|
172
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
173
|
+
var element = _step2.value;
|
|
174
|
+
count[element - min]++;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Reconstruct array
|
|
178
|
+
} catch (err) {
|
|
179
|
+
_iterator2.e(err);
|
|
180
|
+
} finally {
|
|
181
|
+
_iterator2.f();
|
|
182
|
+
}
|
|
183
|
+
var index = 0;
|
|
184
|
+
if (ascending) {
|
|
185
|
+
for (var index_ = 0; index_ < range; index_++) {
|
|
186
|
+
var cnt = count[index_];
|
|
187
|
+
var value = index_ + min;
|
|
188
|
+
for (var _index_ = 0; _index_ < cnt; _index_++) {
|
|
189
|
+
array[index++] = value;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
} else {
|
|
193
|
+
for (var _index_2 = range - 1; _index_2 >= 0; _index_2--) {
|
|
194
|
+
var _cnt = count[_index_2];
|
|
195
|
+
var _value = _index_2 + min;
|
|
196
|
+
for (var _index_3 = 0; _index_3 < _cnt; _index_3++) {
|
|
197
|
+
array[index++] = _value;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return array;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Radix sort for integers
|
|
206
|
+
*/
|
|
207
|
+
var radixSort = function radixSort(array, ascending) {
|
|
208
|
+
var length = array.length;
|
|
209
|
+
|
|
210
|
+
// Separate positive and negative numbers
|
|
211
|
+
var positive = [];
|
|
212
|
+
var negative = [];
|
|
213
|
+
var zeroCount = 0;
|
|
214
|
+
for (var index_ = 0; index_ < length; index_++) {
|
|
215
|
+
if (array[index_] > 0) {
|
|
216
|
+
positive.push(array[index_]);
|
|
217
|
+
} else if (array[index_] < 0) {
|
|
218
|
+
negative.push(-array[index_]);
|
|
219
|
+
} else {
|
|
220
|
+
zeroCount++;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Sort positive numbers
|
|
225
|
+
if (positive.length > 0) {
|
|
226
|
+
radixSortPositive(positive);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Sort negative numbers
|
|
230
|
+
if (negative.length > 0) {
|
|
231
|
+
radixSortPositive(negative);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Merge results
|
|
235
|
+
var index = 0;
|
|
236
|
+
if (ascending) {
|
|
237
|
+
// Negative numbers first (in reverse order)
|
|
238
|
+
for (var _index_4 = negative.length - 1; _index_4 >= 0; _index_4--) {
|
|
239
|
+
array[index++] = -negative[_index_4];
|
|
240
|
+
}
|
|
241
|
+
// Zeros
|
|
242
|
+
for (var _index_5 = 0; _index_5 < zeroCount; _index_5++) {
|
|
243
|
+
array[index++] = 0;
|
|
244
|
+
}
|
|
245
|
+
// Positive numbers
|
|
246
|
+
var _iterator3 = _createForOfIteratorHelper(positive),
|
|
247
|
+
_step3;
|
|
248
|
+
try {
|
|
249
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
250
|
+
var element = _step3.value;
|
|
251
|
+
array[index++] = element;
|
|
252
|
+
}
|
|
253
|
+
} catch (err) {
|
|
254
|
+
_iterator3.e(err);
|
|
255
|
+
} finally {
|
|
256
|
+
_iterator3.f();
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
// Positive numbers first (in reverse order)
|
|
260
|
+
for (var _index_6 = positive.length - 1; _index_6 >= 0; _index_6--) {
|
|
261
|
+
array[index++] = positive[_index_6];
|
|
262
|
+
}
|
|
263
|
+
// Zeros
|
|
264
|
+
for (var _index_7 = 0; _index_7 < zeroCount; _index_7++) {
|
|
265
|
+
array[index++] = 0;
|
|
266
|
+
}
|
|
267
|
+
// Negative numbers
|
|
268
|
+
var _iterator4 = _createForOfIteratorHelper(negative),
|
|
269
|
+
_step4;
|
|
270
|
+
try {
|
|
271
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
272
|
+
var _element = _step4.value;
|
|
273
|
+
array[index++] = -_element;
|
|
274
|
+
}
|
|
275
|
+
} catch (err) {
|
|
276
|
+
_iterator4.e(err);
|
|
277
|
+
} finally {
|
|
278
|
+
_iterator4.f();
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return array;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Radix sort for positive integers
|
|
286
|
+
*/
|
|
287
|
+
var radixSortPositive = function radixSortPositive(array) {
|
|
288
|
+
var length = array.length;
|
|
289
|
+
if (length <= 1) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Find maximum to determine number of digits
|
|
294
|
+
var max = array[0];
|
|
295
|
+
for (var index = 1; index < length; index++) {
|
|
296
|
+
if (array[index] > max) {
|
|
297
|
+
max = array[index];
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Use typed arrays for better performance
|
|
302
|
+
var output = new Float64Array(length);
|
|
303
|
+
var count = new Uint32Array(256);
|
|
304
|
+
|
|
305
|
+
// Process 8 bits at a time
|
|
306
|
+
for (var shift = 0; max >> shift > 0; shift += 8) {
|
|
307
|
+
// Reset count array
|
|
308
|
+
count.fill(0);
|
|
309
|
+
|
|
310
|
+
// Count occurrences
|
|
311
|
+
for (var _index2 = 0; _index2 < length; _index2++) {
|
|
312
|
+
var digit = array[_index2] >> shift & 0xff;
|
|
313
|
+
count[digit]++;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Change count[i] to actual position
|
|
317
|
+
for (var _index3 = 1; _index3 < 256; _index3++) {
|
|
318
|
+
count[_index3] += count[_index3 - 1];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Build output array
|
|
322
|
+
for (var _index4 = length - 1; _index4 >= 0; _index4--) {
|
|
323
|
+
var _digit = array[_index4] >> shift & 0xff;
|
|
324
|
+
output[--count[_digit]] = array[_index4];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Copy back
|
|
328
|
+
for (var _index5 = 0; _index5 < length; _index5++) {
|
|
329
|
+
array[_index5] = output[_index5];
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Optimized quicksort for numbers
|
|
336
|
+
*/
|
|
337
|
+
var numericQuickSort = function numericQuickSort(array, low, high, ascending) {
|
|
338
|
+
var stack = [];
|
|
339
|
+
stack.push(low, high);
|
|
340
|
+
while (stack.length > 0) {
|
|
341
|
+
var h = stack.pop();
|
|
342
|
+
var l = stack.pop();
|
|
343
|
+
if (h === undefined || l === undefined || h <= l) {
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// For small subarrays, use insertion sort
|
|
348
|
+
if (h - l < 16) {
|
|
349
|
+
numericInsertionSort(array, l, h, ascending);
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Partition
|
|
354
|
+
var pivot = numericPartition(array, l, h, ascending);
|
|
355
|
+
|
|
356
|
+
// Push larger partition first to limit stack depth
|
|
357
|
+
if (pivot - l > h - pivot) {
|
|
358
|
+
stack.push(l, pivot - 1, pivot + 1, h);
|
|
359
|
+
} else {
|
|
360
|
+
stack.push(pivot + 1, h, l, pivot - 1);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return array;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Numeric insertion sort
|
|
368
|
+
*/
|
|
369
|
+
var numericInsertionSort = function numericInsertionSort(array, low, high, ascending) {
|
|
370
|
+
if (ascending) {
|
|
371
|
+
for (var index = low + 1; index <= high; index++) {
|
|
372
|
+
var key = array[index];
|
|
373
|
+
var index_ = index - 1;
|
|
374
|
+
while (index_ >= low && array[index_] > key) {
|
|
375
|
+
array[index_ + 1] = array[index_];
|
|
376
|
+
index_--;
|
|
377
|
+
}
|
|
378
|
+
array[index_ + 1] = key;
|
|
379
|
+
}
|
|
380
|
+
} else {
|
|
381
|
+
for (var _index6 = low + 1; _index6 <= high; _index6++) {
|
|
382
|
+
var _key = array[_index6];
|
|
383
|
+
var _index_8 = _index6 - 1;
|
|
384
|
+
while (_index_8 >= low && array[_index_8] < _key) {
|
|
385
|
+
array[_index_8 + 1] = array[_index_8];
|
|
386
|
+
_index_8--;
|
|
387
|
+
}
|
|
388
|
+
array[_index_8 + 1] = _key;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Numeric partition with median-of-three pivot
|
|
395
|
+
*/
|
|
396
|
+
var numericPartition = function numericPartition(array, low, high, ascending) {
|
|
397
|
+
// Median-of-three pivot selection
|
|
398
|
+
var mid = low + (high - low >> 1);
|
|
399
|
+
if (ascending) {
|
|
400
|
+
if (array[mid] < array[low]) {
|
|
401
|
+
var _ref8 = [array[mid], array[low]];
|
|
402
|
+
array[low] = _ref8[0];
|
|
403
|
+
array[mid] = _ref8[1];
|
|
404
|
+
}
|
|
405
|
+
if (array[high] < array[low]) {
|
|
406
|
+
var _ref9 = [array[high], array[low]];
|
|
407
|
+
array[low] = _ref9[0];
|
|
408
|
+
array[high] = _ref9[1];
|
|
409
|
+
}
|
|
410
|
+
if (array[high] < array[mid]) {
|
|
411
|
+
var _ref0 = [array[high], array[mid]];
|
|
412
|
+
array[mid] = _ref0[0];
|
|
413
|
+
array[high] = _ref0[1];
|
|
414
|
+
}
|
|
415
|
+
} else {
|
|
416
|
+
if (array[mid] > array[low]) {
|
|
417
|
+
var _ref1 = [array[mid], array[low]];
|
|
418
|
+
array[low] = _ref1[0];
|
|
419
|
+
array[mid] = _ref1[1];
|
|
420
|
+
}
|
|
421
|
+
if (array[high] > array[low]) {
|
|
422
|
+
var _ref10 = [array[high], array[low]];
|
|
423
|
+
array[low] = _ref10[0];
|
|
424
|
+
array[high] = _ref10[1];
|
|
425
|
+
}
|
|
426
|
+
if (array[high] > array[mid]) {
|
|
427
|
+
var _ref11 = [array[high], array[mid]];
|
|
428
|
+
array[mid] = _ref11[0];
|
|
429
|
+
array[high] = _ref11[1];
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// Move pivot to end-1
|
|
434
|
+
var _ref12 = [array[high - 1], array[mid]];
|
|
435
|
+
array[mid] = _ref12[0];
|
|
436
|
+
array[high - 1] = _ref12[1];
|
|
437
|
+
var pivot = array[high - 1];
|
|
438
|
+
var index = low;
|
|
439
|
+
var index_ = high - 1;
|
|
440
|
+
if (ascending) {
|
|
441
|
+
while (true) {
|
|
442
|
+
while (array[++index] < pivot) {
|
|
443
|
+
// Continue
|
|
444
|
+
}
|
|
445
|
+
while (array[--index_] > pivot) {
|
|
446
|
+
// Continue
|
|
447
|
+
}
|
|
448
|
+
if (index >= index_) {
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
var _ref13 = [array[index_], array[index]];
|
|
452
|
+
array[index] = _ref13[0];
|
|
453
|
+
array[index_] = _ref13[1];
|
|
454
|
+
}
|
|
455
|
+
} else {
|
|
456
|
+
while (true) {
|
|
457
|
+
while (array[++index] > pivot) {
|
|
458
|
+
// Continue
|
|
459
|
+
}
|
|
460
|
+
while (array[--index_] < pivot) {
|
|
461
|
+
// Continue
|
|
462
|
+
}
|
|
463
|
+
if (index >= index_) {
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
var _ref14 = [array[index_], array[index]];
|
|
467
|
+
array[index] = _ref14[0];
|
|
468
|
+
array[index_] = _ref14[1];
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
var _ref15 = [array[high - 1], array[index]];
|
|
472
|
+
array[index] = _ref15[0];
|
|
473
|
+
array[high - 1] = _ref15[1];
|
|
474
|
+
return index;
|
|
475
|
+
};
|
|
@@ -51,7 +51,7 @@ export declare class Pipe<T> {
|
|
|
51
51
|
* @param predicate Condition function that determines if value should be filtered
|
|
52
52
|
* @returns New Pipe instance with Result containing filtered value or error
|
|
53
53
|
*/
|
|
54
|
-
filterResult<U extends T>(predicate: (input: T) => input is U): Pipe<Result<U,
|
|
54
|
+
filterResult<U extends T, E extends Error = Error>(predicate: (input: T) => input is U): Pipe<Result<U, E>>;
|
|
55
55
|
/**
|
|
56
56
|
* Terminates the pipeline and returns the final value
|
|
57
57
|
* @returns Final result of the pipeline processing
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Object validation core module
|
|
3
3
|
* Provides validation functionality for objects with type-specific validation rules for each property
|
|
4
4
|
*/
|
|
5
|
-
import type { ValidateCoreReturnType, ValidateType } from "@/Validate/type";
|
|
5
|
+
import type { Types, ValidateCoreReturnType, ValidateType } from "@/Validate/type";
|
|
6
6
|
/**
|
|
7
7
|
* Creates an object validator with property-specific validation rules
|
|
8
8
|
* @template T - Object type containing validation functions for each property
|
|
@@ -12,8 +12,4 @@ import type { ValidateCoreReturnType, ValidateType } from "@/Validate/type";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const object: <T extends {
|
|
14
14
|
[key: string]: (value: any) => ValidateCoreReturnType<any>;
|
|
15
|
-
}>(option?: T, message?: string) => (value: { [key in keyof T]: ValidateType<ReturnType<T[key]>["type"]>; }) => {
|
|
16
|
-
validate: boolean;
|
|
17
|
-
message: string;
|
|
18
|
-
type: { [key in keyof T]: ValidateType<ReturnType<T[key]>["type"]>; };
|
|
19
|
-
};
|
|
15
|
+
}>(option?: T, message?: string) => (value: Types<{ [key in keyof T]: ValidateType<ReturnType<T[key]>["type"]>; }>) => ValidateCoreReturnType<{ [key in keyof T]: ValidateType<ReturnType<T[key]>["type"]>; }>;
|
|
@@ -33,3 +33,4 @@ export type ValidateFunctionType<T> = (value: T) => boolean;
|
|
|
33
33
|
* @returns The corresponding TypeScript type (string, number, boolean) or the original type T
|
|
34
34
|
*/
|
|
35
35
|
export type ValidateType<T> = T extends "string" ? string : T extends "number" ? number : T extends "boolean" ? boolean : T;
|
|
36
|
+
export type SchemaToInterface<T extends (value: any) => ValidateCoreReturnType<any>> = ReturnType<T>["type"];
|