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,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _isNumber = require("@/Validate/isNumber");
|
|
4
|
-
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); }
|
|
5
|
-
describe("isNumber", function () {
|
|
6
|
-
describe("integers and decimals", function () {
|
|
7
|
-
test("should return true for integer numbers", function () {
|
|
8
|
-
expect((0, _isNumber.isNumber)(5)).toBe(true);
|
|
9
|
-
expect((0, _isNumber.isNumber)(-5)).toBe(true);
|
|
10
|
-
expect((0, _isNumber.isNumber)(0)).toBe(true);
|
|
11
|
-
});
|
|
12
|
-
test("should return true for decimal numbers", function () {
|
|
13
|
-
expect((0, _isNumber.isNumber)(5.5)).toBe(true);
|
|
14
|
-
expect((0, _isNumber.isNumber)(-5.5)).toBe(true);
|
|
15
|
-
expect((0, _isNumber.isNumber)(0.0)).toBe(true);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
describe("string representations (loose mode)", function () {
|
|
19
|
-
test("should return true for valid number strings when loose is true", function () {
|
|
20
|
-
expect((0, _isNumber.isNumber)("5", true)).toBe(true);
|
|
21
|
-
expect((0, _isNumber.isNumber)("-5.5", true)).toBe(true);
|
|
22
|
-
expect((0, _isNumber.isNumber)("0", true)).toBe(true);
|
|
23
|
-
});
|
|
24
|
-
test("should return false for invalid number strings", function () {
|
|
25
|
-
expect((0, _isNumber.isNumber)("abc", true)).toBe(false);
|
|
26
|
-
expect((0, _isNumber.isNumber)("5abc", true)).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
test("should return false for number strings when loose is false", function () {
|
|
29
|
-
expect((0, _isNumber.isNumber)("5", false)).toBe(false);
|
|
30
|
-
expect((0, _isNumber.isNumber)("-5.5", false)).toBe(false);
|
|
31
|
-
});
|
|
32
|
-
test("should handle empty string", function () {
|
|
33
|
-
expect((0, _isNumber.isNumber)("")).toBe(true); // Due to isFinite("") returning true
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
describe("special number values", function () {
|
|
37
|
-
test("should return false for NaN", function () {
|
|
38
|
-
expect((0, _isNumber.isNumber)(Number.NaN)).toBe(false);
|
|
39
|
-
});
|
|
40
|
-
test("should return false for Infinity", function () {
|
|
41
|
-
expect((0, _isNumber.isNumber)(Number.POSITIVE_INFINITY)).toBe(false);
|
|
42
|
-
expect((0, _isNumber.isNumber)(Number.NEGATIVE_INFINITY)).toBe(false);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
describe("non-number types", function () {
|
|
46
|
-
test("should return false for null and undefined", function () {
|
|
47
|
-
expect((0, _isNumber.isNumber)(null)).toBe(false);
|
|
48
|
-
expect((0, _isNumber.isNumber)(undefined)).toBe(false);
|
|
49
|
-
});
|
|
50
|
-
test("should return false for booleans", function () {
|
|
51
|
-
expect((0, _isNumber.isNumber)(true)).toBe(false);
|
|
52
|
-
expect((0, _isNumber.isNumber)(false)).toBe(false);
|
|
53
|
-
});
|
|
54
|
-
test("should return false for objects and arrays", function () {
|
|
55
|
-
expect((0, _isNumber.isNumber)({})).toBe(false);
|
|
56
|
-
expect((0, _isNumber.isNumber)([])).toBe(false);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
describe("type guard functionality", function () {
|
|
60
|
-
test("should work as a type guard in loose mode", function () {
|
|
61
|
-
var value = "123";
|
|
62
|
-
if ((0, _isNumber.isNumber)(value)) {
|
|
63
|
-
// TypeScript should recognize value as number | string
|
|
64
|
-
expect(typeof value === "string" || typeof value === "number").toBe(true);
|
|
65
|
-
expect(Number(value)).toBe(123);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
test("should work as a type guard in strict mode", function () {
|
|
69
|
-
var value = 123;
|
|
70
|
-
if ((0, _isNumber.isNumber)(value, false)) {
|
|
71
|
-
// TypeScript should recognize value as number
|
|
72
|
-
expect(_typeof(value)).toBe("number");
|
|
73
|
-
expect(value).toBe(123);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _isPerfectSquare = require("@/Validate/isPerfectSquare");
|
|
4
|
-
describe("isPerfectSquare", function () {
|
|
5
|
-
it("should return true for a perfect square", function () {
|
|
6
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(16)).toBe(true);
|
|
7
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(25)).toBe(true);
|
|
8
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(49)).toBe(true);
|
|
9
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(0)).toBe(true);
|
|
10
|
-
});
|
|
11
|
-
it("should return false for a non-perfect square", function () {
|
|
12
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(20)).toBe(false);
|
|
13
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(-16)).toBe(false);
|
|
14
|
-
});
|
|
15
|
-
it("should return true for 1", function () {
|
|
16
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(1)).toBe(true);
|
|
17
|
-
});
|
|
18
|
-
it("should handle large numbers", function () {
|
|
19
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(100000000)).toBe(true);
|
|
20
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(100000002)).toBe(false);
|
|
21
|
-
});
|
|
22
|
-
it("should handle non-integer numbers", function () {
|
|
23
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(4.0)).toBe(true); // 4.0 is treated as integer 4
|
|
24
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(4.5)).toBe(false);
|
|
25
|
-
expect((0, _isPerfectSquare.isPerfectSquare)(2.25)).toBe(false);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _isPrimeNumber = require("@/Validate/isPrimeNumber");
|
|
4
|
-
describe("isPrimeNumber", function () {
|
|
5
|
-
test("returns false for numbers less than or equal to 1", function () {
|
|
6
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(0)).toBe(false);
|
|
7
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(1)).toBe(false);
|
|
8
|
-
});
|
|
9
|
-
test("returns true for prime numbers", function () {
|
|
10
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(2)).toBe(true);
|
|
11
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(3)).toBe(true);
|
|
12
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(5)).toBe(true);
|
|
13
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(7)).toBe(true);
|
|
14
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(11)).toBe(true);
|
|
15
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(13)).toBe(true);
|
|
16
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(17)).toBe(true);
|
|
17
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(19)).toBe(true);
|
|
18
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(23)).toBe(true);
|
|
19
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(29)).toBe(true);
|
|
20
|
-
});
|
|
21
|
-
test("returns false for composite numbers", function () {
|
|
22
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(4)).toBe(false);
|
|
23
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(6)).toBe(false);
|
|
24
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(8)).toBe(false);
|
|
25
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(9)).toBe(false);
|
|
26
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(10)).toBe(false);
|
|
27
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(12)).toBe(false);
|
|
28
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(14)).toBe(false);
|
|
29
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(15)).toBe(false);
|
|
30
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(16)).toBe(false);
|
|
31
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(18)).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
test("should return false for negative numbers", function () {
|
|
34
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(-2)).toBe(false);
|
|
35
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(-7)).toBe(false);
|
|
36
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(-11)).toBe(false);
|
|
37
|
-
});
|
|
38
|
-
test("should return false for non-integer numbers", function () {
|
|
39
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(2.5)).toBe(false);
|
|
40
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(3.14)).toBe(false);
|
|
41
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(7.0)).toBe(true); // 7.0 is treated as integer 7
|
|
42
|
-
});
|
|
43
|
-
test("should handle large non-prime numbers", function () {
|
|
44
|
-
var largeNonPrimeNumber = 10000000000000; // 10^13
|
|
45
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(largeNonPrimeNumber)).toBe(false);
|
|
46
|
-
});
|
|
47
|
-
test("should handle large prime numbers", function () {
|
|
48
|
-
var largePrimeNumber = 982451653; // 982,451,653 is a known prime number
|
|
49
|
-
expect((0, _isPrimeNumber.isPrimeNumber)(largePrimeNumber)).toBe(true);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _isValueNaN = require("@/Validate/isValueNaN");
|
|
4
|
-
describe("isValueNaN function", function () {
|
|
5
|
-
describe("strict mode (loose = false)", function () {
|
|
6
|
-
it("should return false for valid numbers", function () {
|
|
7
|
-
expect((0, _isValueNaN.isValueNaN)(0)).toBe(false);
|
|
8
|
-
expect((0, _isValueNaN.isValueNaN)(1)).toBe(false);
|
|
9
|
-
expect((0, _isValueNaN.isValueNaN)(-1)).toBe(false);
|
|
10
|
-
expect((0, _isValueNaN.isValueNaN)(Number.POSITIVE_INFINITY)).toBe(false);
|
|
11
|
-
});
|
|
12
|
-
it("should return true for NaN", function () {
|
|
13
|
-
expect((0, _isValueNaN.isValueNaN)(Number.NaN)).toBe(true);
|
|
14
|
-
expect((0, _isValueNaN.isValueNaN)(Number.parseInt("not a number"))).toBe(true);
|
|
15
|
-
});
|
|
16
|
-
it("should return false for string values", function () {
|
|
17
|
-
expect((0, _isValueNaN.isValueNaN)("NaN")).toBe(false);
|
|
18
|
-
expect((0, _isValueNaN.isValueNaN)("0")).toBe(false);
|
|
19
|
-
expect((0, _isValueNaN.isValueNaN)("a")).toBe(false);
|
|
20
|
-
expect((0, _isValueNaN.isValueNaN)("")).toBe(false);
|
|
21
|
-
});
|
|
22
|
-
it("should return false for non-number types", function () {
|
|
23
|
-
expect((0, _isValueNaN.isValueNaN)(undefined)).toBe(false);
|
|
24
|
-
expect((0, _isValueNaN.isValueNaN)(null)).toBe(false);
|
|
25
|
-
expect((0, _isValueNaN.isValueNaN)({})).toBe(false);
|
|
26
|
-
expect((0, _isValueNaN.isValueNaN)([])).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
describe("loose mode (loose = true)", function () {
|
|
30
|
-
it("should return false for valid number strings", function () {
|
|
31
|
-
expect((0, _isValueNaN.isValueNaN)("0", true)).toBe(false);
|
|
32
|
-
expect((0, _isValueNaN.isValueNaN)("1", true)).toBe(false);
|
|
33
|
-
expect((0, _isValueNaN.isValueNaN)("-1", true)).toBe(false);
|
|
34
|
-
expect((0, _isValueNaN.isValueNaN)("Infinity", true)).toBe(false);
|
|
35
|
-
});
|
|
36
|
-
it("should return true for NaN and NaN strings", function () {
|
|
37
|
-
expect((0, _isValueNaN.isValueNaN)(Number.NaN, true)).toBe(true);
|
|
38
|
-
expect((0, _isValueNaN.isValueNaN)("NaN", true)).toBe(true);
|
|
39
|
-
expect((0, _isValueNaN.isValueNaN)(Number.parseInt("not a number"), true)).toBe(true);
|
|
40
|
-
});
|
|
41
|
-
it("should handle non-numeric strings correctly", function () {
|
|
42
|
-
expect((0, _isValueNaN.isValueNaN)("a", true)).toBe(true);
|
|
43
|
-
expect((0, _isValueNaN.isValueNaN)("abc", true)).toBe(true);
|
|
44
|
-
expect((0, _isValueNaN.isValueNaN)("", true)).toBe(false); // isNaN("") returns false
|
|
45
|
-
expect((0, _isValueNaN.isValueNaN)(" ", true)).toBe(false); // isNaN(" ") returns false (coerced to 0)
|
|
46
|
-
});
|
|
47
|
-
it("should handle non-string/non-number types", function () {
|
|
48
|
-
expect((0, _isValueNaN.isValueNaN)(undefined, true)).toBe(true);
|
|
49
|
-
expect((0, _isValueNaN.isValueNaN)(null, true)).toBe(false);
|
|
50
|
-
expect((0, _isValueNaN.isValueNaN)({}, true)).toBe(true);
|
|
51
|
-
expect((0, _isValueNaN.isValueNaN)([], true)).toBe(false);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _core = require("@/Validate/number/core");
|
|
4
|
-
var _maxValue = require("@/Validate/number/maxValue");
|
|
5
|
-
var _minValue = require("@/Validate/number/minValue");
|
|
6
|
-
describe("number function", function () {
|
|
7
|
-
it("should validate number with no additional options", function () {
|
|
8
|
-
var validateNumber = (0, _core.number)();
|
|
9
|
-
expect(validateNumber(5).validate).toBeTruthy();
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
expect(validateNumber("5").validate).toBeFalsy();
|
|
12
|
-
});
|
|
13
|
-
it("should validate number with max value option", function () {
|
|
14
|
-
var validateNumberMax = (0, _core.number)([(0, _maxValue.maxValue)(10)]);
|
|
15
|
-
expect(validateNumberMax(5).validate).toBeTruthy();
|
|
16
|
-
expect(validateNumberMax(11).validate).toBeFalsy();
|
|
17
|
-
});
|
|
18
|
-
it("should validate number with min value option", function () {
|
|
19
|
-
var validateNumberMin = (0, _core.number)([(0, _minValue.minValue)(3)]);
|
|
20
|
-
expect(validateNumberMin(5).validate).toBeTruthy();
|
|
21
|
-
expect(validateNumberMin(2).validate).toBeFalsy();
|
|
22
|
-
});
|
|
23
|
-
it("should validate number with both min and max value options", function () {
|
|
24
|
-
var validateNumberMinMax = (0, _core.number)([(0, _minValue.minValue)(3), (0, _maxValue.maxValue)(10)]);
|
|
25
|
-
expect(validateNumberMinMax(5).validate).toBeTruthy();
|
|
26
|
-
expect(validateNumberMinMax(2).validate).toBeFalsy();
|
|
27
|
-
expect(validateNumberMinMax(11).validate).toBeFalsy();
|
|
28
|
-
});
|
|
29
|
-
it("should return custom message on validation failure", function () {
|
|
30
|
-
var customMessage = "Value must be between 3 and 10";
|
|
31
|
-
var validateNumberMinMax = (0, _core.number)([(0, _minValue.minValue)(3, customMessage), (0, _maxValue.maxValue)(10)]);
|
|
32
|
-
var result = validateNumberMinMax(2);
|
|
33
|
-
expect(result.validate).toBeFalsy();
|
|
34
|
-
expect(result.message).toBe(customMessage);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _double2 = require("@/Validate/number/double");
|
|
4
|
-
describe("double", function () {
|
|
5
|
-
it("should return true for double numbers", function () {
|
|
6
|
-
var validateDouble = (0, _double2["double"])();
|
|
7
|
-
expect(validateDouble.validate(1.5)).toBe(true);
|
|
8
|
-
expect(validateDouble.validate(2.22)).toBe(true);
|
|
9
|
-
expect(validateDouble.validate(0.1)).toBe(true);
|
|
10
|
-
});
|
|
11
|
-
it("should return false for non-double numbers", function () {
|
|
12
|
-
var validateDouble = (0, _double2["double"])();
|
|
13
|
-
expect(validateDouble.validate(1)).toBe(false);
|
|
14
|
-
expect(validateDouble.validate(100)).toBe(false);
|
|
15
|
-
expect(validateDouble.validate(0)).toBe(false);
|
|
16
|
-
});
|
|
17
|
-
it("should return the custom message for invalid input", function () {
|
|
18
|
-
var customMessage = "This is not a double number";
|
|
19
|
-
var validateDouble = (0, _double2["double"])(customMessage);
|
|
20
|
-
expect(validateDouble.validate(1)).toBe(false);
|
|
21
|
-
expect(validateDouble.message).toBe(customMessage);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _even = require("@/Validate/number/even");
|
|
4
|
-
describe("even", function () {
|
|
5
|
-
it("should return true for even numbers", function () {
|
|
6
|
-
var validateEven = (0, _even.even)();
|
|
7
|
-
expect(validateEven.validate(2)).toBe(true);
|
|
8
|
-
expect(validateEven.validate(4)).toBe(true);
|
|
9
|
-
expect(validateEven.validate(6)).toBe(true);
|
|
10
|
-
});
|
|
11
|
-
it("should return false for odd numbers", function () {
|
|
12
|
-
var validateEven = (0, _even.even)();
|
|
13
|
-
expect(validateEven.validate(1)).toBe(false);
|
|
14
|
-
expect(validateEven.validate(3)).toBe(false);
|
|
15
|
-
expect(validateEven.validate(5)).toBe(false);
|
|
16
|
-
});
|
|
17
|
-
it("should return the custom message for invalid input", function () {
|
|
18
|
-
var customMessage = "This is a custom message";
|
|
19
|
-
var validateEven = (0, _even.even)(customMessage);
|
|
20
|
-
expect(validateEven.validate(1)).toBe(false);
|
|
21
|
-
expect(validateEven.message).toBe(customMessage);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _maxValue = require("@/Validate/number/maxValue");
|
|
4
|
-
describe("maxValue", function () {
|
|
5
|
-
it("should return true for numbers less than or equal to the max value", function () {
|
|
6
|
-
var validateMaxValue = (0, _maxValue.maxValue)(10);
|
|
7
|
-
expect(validateMaxValue.validate(5)).toBe(true);
|
|
8
|
-
expect(validateMaxValue.validate(10)).toBe(true);
|
|
9
|
-
});
|
|
10
|
-
it("should return false for numbers greater than the max value", function () {
|
|
11
|
-
var validateMaxValue = (0, _maxValue.maxValue)(10);
|
|
12
|
-
expect(validateMaxValue.validate(11)).toBe(false);
|
|
13
|
-
});
|
|
14
|
-
it("should return the custom message for invalid input", function () {
|
|
15
|
-
var customMessage = "Value must be less than or equal to 10";
|
|
16
|
-
var validateMaxValue = (0, _maxValue.maxValue)(10, customMessage);
|
|
17
|
-
expect(validateMaxValue.validate(11)).toBe(false);
|
|
18
|
-
expect(validateMaxValue.message).toBe(customMessage);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _minValue = require("@/Validate/number/minValue");
|
|
4
|
-
describe("minValue", function () {
|
|
5
|
-
it("should return true for numbers greater than or equal to the minimum value", function () {
|
|
6
|
-
var validateMinValue = (0, _minValue.minValue)(10);
|
|
7
|
-
expect(validateMinValue.validate(10)).toBe(true);
|
|
8
|
-
expect(validateMinValue.validate(15)).toBe(true);
|
|
9
|
-
});
|
|
10
|
-
it("should return false for numbers less than the minimum value", function () {
|
|
11
|
-
var validateMinValue = (0, _minValue.minValue)(10);
|
|
12
|
-
expect(validateMinValue.validate(9)).toBe(false);
|
|
13
|
-
});
|
|
14
|
-
it("should return the custom message for invalid input", function () {
|
|
15
|
-
var customMessage = "Value must be at least 10";
|
|
16
|
-
var validateMinValue = (0, _minValue.minValue)(10, customMessage);
|
|
17
|
-
expect(validateMinValue.validate(9)).toBe(false);
|
|
18
|
-
expect(validateMinValue.message).toBe(customMessage);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _odd = require("@/Validate/number/odd");
|
|
4
|
-
describe("odd", function () {
|
|
5
|
-
it("should return true for odd numbers", function () {
|
|
6
|
-
var validateOdd = (0, _odd.odd)();
|
|
7
|
-
expect(validateOdd.validate(1)).toBe(true);
|
|
8
|
-
expect(validateOdd.validate(3)).toBe(true);
|
|
9
|
-
expect(validateOdd.validate(5)).toBe(true);
|
|
10
|
-
});
|
|
11
|
-
it("should return false for even numbers", function () {
|
|
12
|
-
var validateOdd = (0, _odd.odd)();
|
|
13
|
-
expect(validateOdd.validate(2)).toBe(false);
|
|
14
|
-
expect(validateOdd.validate(4)).toBe(false);
|
|
15
|
-
expect(validateOdd.validate(6)).toBe(false);
|
|
16
|
-
});
|
|
17
|
-
it("should return the custom message for invalid input", function () {
|
|
18
|
-
var customMessage = "This is a custom message";
|
|
19
|
-
var validateOdd = (0, _odd.odd)(customMessage);
|
|
20
|
-
expect(validateOdd.validate(2)).toBe(false);
|
|
21
|
-
expect(validateOdd.message).toBe(customMessage);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _prime = require("@/Validate/number/prime");
|
|
4
|
-
describe("prime", function () {
|
|
5
|
-
it("should return true for prime numbers", function () {
|
|
6
|
-
var validatePrime = (0, _prime.prime)();
|
|
7
|
-
expect(validatePrime.validate(2)).toBe(true);
|
|
8
|
-
expect(validatePrime.validate(3)).toBe(true);
|
|
9
|
-
expect(validatePrime.validate(5)).toBe(true);
|
|
10
|
-
expect(validatePrime.validate(7)).toBe(true);
|
|
11
|
-
});
|
|
12
|
-
it("should return false for non-prime numbers", function () {
|
|
13
|
-
var validatePrime = (0, _prime.prime)();
|
|
14
|
-
expect(validatePrime.validate(4)).toBe(false);
|
|
15
|
-
expect(validatePrime.validate(6)).toBe(false);
|
|
16
|
-
expect(validatePrime.validate(8)).toBe(false);
|
|
17
|
-
expect(validatePrime.validate(9)).toBe(false);
|
|
18
|
-
});
|
|
19
|
-
it("should return the custom message for invalid input", function () {
|
|
20
|
-
var customMessage = "This is not a prime number";
|
|
21
|
-
var validatePrime = (0, _prime.prime)(customMessage);
|
|
22
|
-
expect(validatePrime.validate(4)).toBe(false);
|
|
23
|
-
expect(validatePrime.message).toBe(customMessage);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Validate = require("@/Validate");
|
|
4
|
-
var _number = require("@/Validate/number");
|
|
5
|
-
var _core = require("@/Validate/object/core");
|
|
6
|
-
var _string = require("@/Validate/string");
|
|
7
|
-
describe("object validation", function () {
|
|
8
|
-
it("should validate an object with string type", function () {
|
|
9
|
-
var validateObject = (0, _core.object)();
|
|
10
|
-
var invalidData = {
|
|
11
|
-
name: "John Doe",
|
|
12
|
-
age: "thirty"
|
|
13
|
-
};
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
var result = validateObject(invalidData);
|
|
16
|
-
expect(result.validate).toBe(true);
|
|
17
|
-
});
|
|
18
|
-
it("should validate an object with string and number types", function () {
|
|
19
|
-
var validateObject = (0, _core.object)({
|
|
20
|
-
name: (0, _string.string)([], "string"),
|
|
21
|
-
age: (0, _number.number)([], "number"),
|
|
22
|
-
array: (0, _Validate.array)({
|
|
23
|
-
string: (0, _string.string)([], "string"),
|
|
24
|
-
number: (0, _number.number)([], "number")
|
|
25
|
-
}, "array")
|
|
26
|
-
}, "object");
|
|
27
|
-
var validData = {
|
|
28
|
-
name: "John Doe",
|
|
29
|
-
age: 30,
|
|
30
|
-
array: ["John Doe", 30]
|
|
31
|
-
};
|
|
32
|
-
var invalidData = {
|
|
33
|
-
name: "John Doe",
|
|
34
|
-
age: "thirty"
|
|
35
|
-
};
|
|
36
|
-
expect(validateObject(validData).message).toBe("");
|
|
37
|
-
expect(validateObject(validData).validate).toBe(true);
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
expect(validateObject(invalidData).validate).toBe(false);
|
|
40
|
-
});
|
|
41
|
-
it("should return a custom message on number validation failure", function () {
|
|
42
|
-
var customMessage = "Invalid object structure";
|
|
43
|
-
var validateObject = (0, _core.object)({
|
|
44
|
-
name: (0, _string.string)(),
|
|
45
|
-
age: (0, _number.number)([], customMessage)
|
|
46
|
-
});
|
|
47
|
-
var invalidData = {
|
|
48
|
-
name: "John Doe",
|
|
49
|
-
age: "thirty"
|
|
50
|
-
};
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
var result = validateObject(invalidData);
|
|
53
|
-
expect(result.validate).toBe(false);
|
|
54
|
-
expect(result.message).toBe(customMessage);
|
|
55
|
-
});
|
|
56
|
-
it("should return a custom message on validation failure", function () {
|
|
57
|
-
var customMessage = "Invalid object structure";
|
|
58
|
-
var validateObject = (0, _core.object)({
|
|
59
|
-
name: (0, _string.string)(),
|
|
60
|
-
age: (0, _number.number)()
|
|
61
|
-
}, customMessage);
|
|
62
|
-
var invalidData = "John Doe";
|
|
63
|
-
// @ts-ignore
|
|
64
|
-
var result = validateObject(invalidData);
|
|
65
|
-
expect(result.validate).toBe(false);
|
|
66
|
-
expect(result.message).toBe(customMessage);
|
|
67
|
-
});
|
|
68
|
-
it("should return an empty message on validation failure", function () {
|
|
69
|
-
var validateObject = (0, _core.object)({
|
|
70
|
-
name: (0, _string.string)(),
|
|
71
|
-
age: (0, _number.number)()
|
|
72
|
-
});
|
|
73
|
-
var invalidData = "John Doe";
|
|
74
|
-
// @ts-ignore
|
|
75
|
-
var result = validateObject(invalidData);
|
|
76
|
-
expect(result.validate).toBe(false);
|
|
77
|
-
expect(result.message).toBe("");
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _string = require("@/Validate/string");
|
|
4
|
-
describe("string validation", function () {
|
|
5
|
-
it("string", function () {
|
|
6
|
-
var validateString = (0, _string.string)();
|
|
7
|
-
expect(validateString("").validate).toBeTruthy();
|
|
8
|
-
expect(validateString("abc").validate).toBeTruthy();
|
|
9
|
-
// @ts-expect-error
|
|
10
|
-
expect(validateString(123).validate).toBeFalsy();
|
|
11
|
-
});
|
|
12
|
-
it("string with message", function () {
|
|
13
|
-
var validateStringWithMessage = (0, _string.string)([], "Must be string");
|
|
14
|
-
expect(validateStringWithMessage("").message).toEqual("");
|
|
15
|
-
expect(validateStringWithMessage("abc").validate).toBeTruthy();
|
|
16
|
-
// @ts-expect-error
|
|
17
|
-
expect(validateStringWithMessage(123).validate).toBeFalsy();
|
|
18
|
-
});
|
|
19
|
-
it("can specify the maximum and minimum number of characters", function () {
|
|
20
|
-
var validateString = (0, _string.string)([(0, _string.minLength)(3), (0, _string.maxLength)(5)]);
|
|
21
|
-
expect(validateString("ab").validate).toBeFalsy();
|
|
22
|
-
expect(validateString("abc").validate).toBeTruthy();
|
|
23
|
-
expect(validateString("abcde").validate).toBeTruthy();
|
|
24
|
-
expect(validateString("abcdef").validate).toBeFalsy();
|
|
25
|
-
expect(validateString("abcdefg").validate).toBeFalsy();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Validate = require("@/Validate");
|
|
4
|
-
var _email = require("@/Validate/string/email");
|
|
5
|
-
describe("email", function () {
|
|
6
|
-
it("email with message", function () {
|
|
7
|
-
var emailValidatorWithMessage = (0, _email.email)("Invalid email format");
|
|
8
|
-
var validateEmailWithMessage = (0, _Validate.string)([emailValidatorWithMessage]);
|
|
9
|
-
expect(validateEmailWithMessage("user@example.com").message).toEqual("");
|
|
10
|
-
expect(validateEmailWithMessage("user@example.com").validate).toBeTruthy();
|
|
11
|
-
expect(validateEmailWithMessage("userexample.com").message).toEqual("Invalid email format");
|
|
12
|
-
expect(validateEmailWithMessage("userexample.com").validate).toBeFalsy();
|
|
13
|
-
});
|
|
14
|
-
it("email without message", function () {
|
|
15
|
-
var emailValidatorWithoutMessage = (0, _email.email)();
|
|
16
|
-
var validateEmailWithoutMessage = (0, _Validate.string)([emailValidatorWithoutMessage]);
|
|
17
|
-
expect(validateEmailWithoutMessage("user@example.com").message).toEqual("");
|
|
18
|
-
expect(validateEmailWithoutMessage("user@example.com").validate).toBeTruthy();
|
|
19
|
-
expect(validateEmailWithoutMessage("userexample.com").validate).toBeFalsy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _string = require("@/Validate/string");
|
|
4
|
-
describe("length", function () {
|
|
5
|
-
it("length with message", function () {
|
|
6
|
-
var lengthValidatorWithMessage = (0, _string.length_)(3, "Length must be 3");
|
|
7
|
-
var validateStringWithMessage = (0, _string.string)([lengthValidatorWithMessage]);
|
|
8
|
-
expect(validateStringWithMessage("abcd").message).toEqual("Length must be 3");
|
|
9
|
-
expect(validateStringWithMessage("abc").validate).toBeTruthy();
|
|
10
|
-
expect(validateStringWithMessage("ab").validate).toBeFalsy();
|
|
11
|
-
});
|
|
12
|
-
it("length without message", function () {
|
|
13
|
-
var lengthValidatorWithoutMessage = (0, _string.length_)(3);
|
|
14
|
-
var validateStringWithoutMessage = (0, _string.string)([lengthValidatorWithoutMessage]);
|
|
15
|
-
expect(validateStringWithoutMessage("abc").message).toEqual("");
|
|
16
|
-
expect(validateStringWithoutMessage("abcd").validate).toBeFalsy();
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _string = require("@/Validate/string");
|
|
4
|
-
describe("maxLength", function () {
|
|
5
|
-
it("maxLength with message", function () {
|
|
6
|
-
var maxLengthValidatorWithMessage = (0, _string.maxLength)(3, "Maximum length is 3");
|
|
7
|
-
var validateStringWithMessage = (0, _string.string)([maxLengthValidatorWithMessage]);
|
|
8
|
-
expect(validateStringWithMessage("abcd").message).toEqual("Maximum length is 3");
|
|
9
|
-
expect(validateStringWithMessage("abc").validate).toBeTruthy();
|
|
10
|
-
expect(validateStringWithMessage("ab").validate).toBeTruthy();
|
|
11
|
-
});
|
|
12
|
-
it("maxLength without message", function () {
|
|
13
|
-
var maxLengthValidatorWithoutMessage = (0, _string.maxLength)(3);
|
|
14
|
-
var validateStringWithoutMessage = (0, _string.string)([maxLengthValidatorWithoutMessage]);
|
|
15
|
-
expect(validateStringWithoutMessage("abc").message).toEqual("");
|
|
16
|
-
expect(validateStringWithoutMessage("abcd").validate).toBeFalsy();
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _string = require("@/Validate/string");
|
|
4
|
-
describe("minLength", function () {
|
|
5
|
-
it("minLength with message", function () {
|
|
6
|
-
var minLengthValidatorWithMessage = (0, _string.minLength)(3, "Minimum length is 3");
|
|
7
|
-
var validateStringWithMessage = (0, _string.string)([minLengthValidatorWithMessage]);
|
|
8
|
-
expect(validateStringWithMessage("").message).toEqual("Minimum length is 3");
|
|
9
|
-
expect(validateStringWithMessage("ab").validate).toBeFalsy();
|
|
10
|
-
expect(validateStringWithMessage("abc").validate).toBeTruthy();
|
|
11
|
-
});
|
|
12
|
-
it("minLength without message", function () {
|
|
13
|
-
var minLengthValidatorWithoutMessage = (0, _string.minLength)(3);
|
|
14
|
-
var validateStringWithoutMessage = (0, _string.string)([minLengthValidatorWithoutMessage]);
|
|
15
|
-
expect(validateStringWithoutMessage("abc").message).toEqual("");
|
|
16
|
-
expect(validateStringWithoutMessage("ab").validate).toBeFalsy();
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|