umt 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/module/Advance/rangeAdvance.d.ts +10 -6
- package/module/Advance/rangeAdvance.js +10 -6
- package/module/Advance/rangeAdvance.js.map +1 -1
- package/module/Array/arraysJoin.d.ts +4 -4
- package/module/Array/arraysJoin.js +4 -4
- package/module/Array/binarySearch.d.ts +4 -3
- package/module/Array/binarySearch.js +4 -3
- package/module/Array/binarySearch.js.map +1 -1
- package/module/Array/checkFlagAlignment.d.ts +3 -3
- package/module/Array/checkFlagAlignment.js +7 -7
- package/module/Array/checkFlagAlignment.js.map +1 -1
- package/module/Array/chunk.d.ts +4 -4
- package/module/Array/compact.d.ts +8 -0
- package/module/Array/compact.js +8 -0
- package/module/Array/compact.js.map +1 -1
- package/module/Array/compareFunctionDefault.d.ts +13 -0
- package/module/Array/compareFunctionDefault.js +13 -0
- package/module/Array/compareFunctionDefault.js.map +1 -1
- package/module/Array/drop.d.ts +5 -5
- package/module/Array/drop.js +5 -5
- package/module/Array/dualPivotQuickSort.d.ts +16 -0
- package/module/Array/dualPivotQuickSort.js +152 -0
- package/module/Array/dualPivotQuickSort.js.map +1 -0
- package/module/Array/first.d.ts +3 -3
- package/module/Array/first.js +3 -3
- package/module/Array/generateNumberArray.d.ts +6 -6
- package/module/Array/generateNumberArray.js +6 -6
- package/module/Array/getArraysCommon.d.ts +4 -4
- package/module/Array/getArraysCommon.js +4 -4
- package/module/Array/getArraysDiff.d.ts +4 -4
- package/module/Array/getArraysDiff.js +4 -4
- package/module/Array/groupBy.d.ts +8 -4
- package/module/Array/groupBy.js +8 -4
- 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/insertionSort.d.ts +8 -7
- package/module/Array/insertionSort.js +6 -6
- package/module/Array/insertionSort.js.map +1 -1
- package/module/Array/mergeSort.d.ts +6 -5
- package/module/Array/mergeSort.js +9 -9
- package/module/Array/mergeSort.js.map +1 -1
- package/module/Array/quickSort.d.ts +12 -11
- package/module/Array/quickSort.js +44 -10
- package/module/Array/quickSort.js.map +1 -1
- package/module/Array/randomSelect.d.ts +5 -5
- package/module/Array/randomSelect.js +5 -5
- package/module/Array/range.d.ts +5 -5
- package/module/Array/range.js +26 -10
- package/module/Array/range.js.map +1 -1
- package/module/Array/shuffle.d.ts +3 -3
- package/module/Array/shuffle.js +3 -3
- package/module/Array/shuffle2DArray.d.ts +4 -4
- package/module/Array/shuffle2DArray.js +6 -6
- package/module/Array/shuffle2DArray.js.map +1 -1
- package/module/Array/sum.d.ts +3 -3
- package/module/Array/sum.js +4 -4
- package/module/Array/sum.js.map +1 -1
- package/module/Array/timSort.d.ts +13 -11
- package/module/Array/timSort.js +33 -9
- package/module/Array/timSort.js.map +1 -1
- package/module/Array/zip.d.ts +6 -3
- package/module/Array/zip.js +6 -3
- package/module/Array/zip.js.map +1 -1
- package/module/Array/zipLongest.d.ts +8 -5
- package/module/Array/zipLongest.js +8 -5
- package/module/Array/zipLongest.js.map +1 -1
- package/module/Color/cmykToRgba.d.ts +7 -7
- package/module/Color/cmykToRgba.js +12 -12
- package/module/Color/cmykToRgba.js.map +1 -1
- package/module/Color/hexaToRgba.d.ts +4 -3
- package/module/Color/hexaToRgba.js +18 -7
- package/module/Color/hexaToRgba.js.map +1 -1
- package/module/Color/hslaToRgba.d.ts +7 -6
- package/module/Color/hslaToRgba.js +19 -15
- package/module/Color/hslaToRgba.js.map +1 -1
- package/module/Color/rgbaToCmyk.d.ts +3 -3
- package/module/Color/rgbaToCmyk.js +14 -3
- package/module/Color/rgbaToCmyk.js.map +1 -1
- package/module/Color/rgbaToHexA.d.ts +4 -4
- package/module/Color/rgbaToHexA.js +5 -5
- package/module/Color/rgbaToHexA.js.map +1 -1
- package/module/Color/rgbaToHsla.d.ts +4 -3
- package/module/Color/rgbaToHsla.js +15 -3
- package/module/Color/rgbaToHsla.js.map +1 -1
- package/module/Consts/clock.d.ts +11 -11
- package/module/Consts/clock.js +11 -11
- package/module/Consts/httpStatus/httpClientErrorStatus.d.ts +28 -0
- package/module/Consts/httpStatus/httpClientErrorStatus.js +28 -0
- package/module/Consts/httpStatus/httpClientErrorStatus.js.map +1 -1
- package/module/Consts/httpStatus/httpInformationalStatus.d.ts +9 -0
- package/module/Consts/httpStatus/httpInformationalStatus.js +9 -0
- package/module/Consts/httpStatus/httpInformationalStatus.js.map +1 -1
- package/module/Consts/httpStatus/httpRedirectionStatus.d.ts +11 -0
- package/module/Consts/httpStatus/httpRedirectionStatus.js +11 -0
- package/module/Consts/httpStatus/httpRedirectionStatus.js.map +1 -1
- package/module/Consts/httpStatus/httpServerErrorStatus.d.ts +10 -0
- package/module/Consts/httpStatus/httpServerErrorStatus.js +10 -0
- package/module/Consts/httpStatus/httpServerErrorStatus.js.map +1 -1
- package/module/Consts/httpStatus/httpSuccessStatus.d.ts +11 -0
- package/module/Consts/httpStatus/httpSuccessStatus.js +11 -0
- package/module/Consts/httpStatus/httpSuccessStatus.js.map +1 -1
- package/module/Date/birthday.d.ts +7 -6
- package/module/Date/birthday.js +7 -6
- package/module/Date/birthday.js.map +1 -1
- package/module/Date/dateRange.d.ts +7 -4
- package/module/Date/dateRange.js +7 -4
- package/module/Date/dateRange.js.map +1 -1
- package/module/Date/dayOfWeek.d.ts +4 -4
- package/module/Date/dayOfWeek.js +4 -4
- package/module/Date/format.d.ts +30 -4
- package/module/Date/format.js +30 -4
- package/module/Date/format.js.map +1 -1
- package/module/Date/getDay.d.ts +8 -5
- package/module/Date/getDay.js +8 -5
- package/module/Date/getDay.js.map +1 -1
- package/module/Date/getTimezoneOffsetString.d.ts +3 -3
- package/module/Date/getTimezoneOffsetString.js +3 -3
- package/module/Date/isLeapYear.d.ts +8 -3
- package/module/Date/isLeapYear.js +8 -3
- package/module/Date/isLeapYear.js.map +1 -1
- package/module/Date/new.d.ts +20 -20
- package/module/Date/new.js +21 -21
- package/module/Date/new.js.map +1 -1
- package/module/Date/now.d.ts +7 -4
- package/module/Date/now.js +7 -4
- package/module/Date/now.js.map +1 -1
- package/module/Error/safeExecute.d.ts +21 -0
- package/module/Error/safeExecute.js +20 -0
- package/module/Error/safeExecute.js.map +1 -1
- package/module/IP/cidrToLong.d.ts +4 -3
- package/module/IP/cidrToLong.js +10 -4
- package/module/IP/cidrToLong.js.map +1 -1
- package/module/IP/cidrToSubnetMask.d.ts +4 -3
- package/module/IP/cidrToSubnetMask.js +4 -3
- package/module/IP/cidrToSubnetMask.js.map +1 -1
- package/module/IP/getIpClass.d.ts +3 -3
- package/module/IP/getIpClass.js +30 -18
- package/module/IP/getIpClass.js.map +1 -1
- package/module/IP/getNetworkAddress.d.ts +5 -4
- package/module/IP/getNetworkAddress.js +36 -6
- package/module/IP/getNetworkAddress.js.map +1 -1
- package/module/IP/ipToBinaryString.d.ts +4 -3
- package/module/IP/ipToBinaryString.js +32 -7
- package/module/IP/ipToBinaryString.js.map +1 -1
- package/module/IP/ipToLong.d.ts +4 -3
- package/module/IP/ipToLong.js +4 -3
- package/module/IP/ipToLong.js.map +1 -1
- package/module/IP/isInRange.d.ts +6 -5
- package/module/IP/isInRange.js +33 -7
- package/module/IP/isInRange.js.map +1 -1
- package/module/IP/isPrivateIp.d.ts +4 -3
- package/module/IP/isPrivateIp.js +17 -9
- package/module/IP/isPrivateIp.js.map +1 -1
- package/module/IP/longToIp.d.ts +4 -3
- package/module/IP/longToIp.js +16 -4
- package/module/IP/longToIp.js.map +1 -1
- package/module/IP/subnetMaskToCidr.d.ts +4 -3
- package/module/IP/subnetMaskToCidr.js +28 -12
- package/module/IP/subnetMaskToCidr.js.map +1 -1
- package/module/Math/addition.d.ts +3 -3
- package/module/Math/addition.js +3 -3
- package/module/Math/average.d.ts +7 -4
- package/module/Math/average.js +7 -4
- package/module/Math/average.js.map +1 -1
- package/module/Math/bitwise.d.ts +5 -5
- package/module/Math/bitwise.js +5 -5
- package/module/Math/calculator/calculator.d.ts +9 -7
- package/module/Math/calculator/calculator.js +9 -7
- package/module/Math/calculator/calculator.js.map +1 -1
- package/module/Math/calculator/calculatorInitialization.d.ts +4 -3
- package/module/Math/calculator/calculatorInitialization.js +6 -5
- package/module/Math/calculator/calculatorInitialization.js.map +1 -1
- package/module/Math/calculator/convertCurrency.d.ts +6 -4
- package/module/Math/calculator/convertCurrency.js +6 -4
- package/module/Math/calculator/convertCurrency.js.map +1 -1
- package/module/Math/calculator/core.js +13 -13
- package/module/Math/calculator/core.js.map +1 -1
- package/module/Math/calculator/literalExpression.d.ts +5 -3
- package/module/Math/calculator/literalExpression.js +12 -10
- package/module/Math/calculator/literalExpression.js.map +1 -1
- package/module/Math/degToRad.d.ts +3 -3
- package/module/Math/degToRad.js +3 -3
- package/module/Math/deviationValue.d.ts +5 -5
- package/module/Math/deviationValue.js +5 -5
- package/module/Math/division.d.ts +5 -5
- package/module/Math/division.js +31 -21
- package/module/Math/division.js.map +1 -1
- package/module/Math/factorial.d.ts +3 -3
- package/module/Math/factorial.js +3 -3
- package/module/Math/factorize.d.ts +3 -3
- package/module/Math/factorize.js +3 -3
- package/module/Math/flexibleNumberConversion.d.ts +11 -11
- package/module/Math/flexibleNumberConversion.js +19 -19
- package/module/Math/flexibleNumberConversion.js.map +1 -1
- package/module/Math/gcd.d.ts +5 -5
- package/module/Math/gcd.js +6 -6
- package/module/Math/gcd.js.map +1 -1
- package/module/Math/getDecimalLength.d.ts +7 -4
- package/module/Math/getDecimalLength.js +9 -5
- package/module/Math/getDecimalLength.js.map +1 -1
- package/module/Math/lcm.d.ts +4 -4
- package/module/Math/lcm.js +5 -5
- package/module/Math/lcm.js.map +1 -1
- package/module/Math/linearCongruentialGenerator.d.ts +6 -6
- package/module/Math/linearCongruentialGenerator.js +6 -6
- package/module/Math/mathConverter.d.ts +7 -3
- package/module/Math/mathConverter.js +7 -3
- package/module/Math/mathConverter.js.map +1 -1
- package/module/Math/mathSeparator.d.ts +8 -3
- package/module/Math/mathSeparator.js +8 -3
- package/module/Math/mathSeparator.js.map +1 -1
- package/module/Math/max.d.ts +4 -3
- package/module/Math/max.js +4 -3
- package/module/Math/max.js.map +1 -1
- package/module/Math/median.d.ts +3 -3
- package/module/Math/median.js +3 -3
- package/module/Math/min.d.ts +4 -3
- package/module/Math/min.js +4 -3
- package/module/Math/min.js.map +1 -1
- package/module/Math/multiples.d.ts +4 -4
- package/module/Math/multiples.js +4 -4
- package/module/Math/multiplication.d.ts +3 -3
- package/module/Math/multiplication.js +3 -3
- package/module/Math/nCr.d.ts +7 -4
- package/module/Math/nCr.js +7 -4
- package/module/Math/nCr.js.map +1 -1
- package/module/Math/nHr.d.ts +7 -4
- package/module/Math/nHr.js +7 -4
- package/module/Math/nHr.js.map +1 -1
- package/module/Math/nPr.d.ts +7 -4
- package/module/Math/nPr.js +7 -4
- package/module/Math/nPr.js.map +1 -1
- package/module/Math/primeFactorization.d.ts +6 -3
- package/module/Math/primeFactorization.js +11 -8
- package/module/Math/primeFactorization.js.map +1 -1
- package/module/Math/quotient.d.ts +7 -4
- package/module/Math/quotient.js +7 -4
- package/module/Math/quotient.js.map +1 -1
- package/module/Math/radToDeg.d.ts +5 -3
- package/module/Math/radToDeg.js +5 -3
- package/module/Math/radToDeg.js.map +1 -1
- package/module/Math/random.d.ts +6 -5
- package/module/Math/random.js +6 -5
- package/module/Math/random.js.map +1 -1
- package/module/Math/reduce.d.ts +9 -4
- package/module/Math/reduce.js +16 -6
- package/module/Math/reduce.js.map +1 -1
- package/module/Math/repeatedTrial.d.ts +5 -5
- package/module/Math/repeatedTrial.js +5 -5
- package/module/Math/roundOf.d.ts +7 -5
- package/module/Math/roundOf.js +8 -6
- package/module/Math/roundOf.js.map +1 -1
- package/module/Math/solveEquation.d.ts +12 -13
- package/module/Math/solveEquation.js +32 -37
- package/module/Math/solveEquation.js.map +1 -1
- package/module/Math/standardDeviation.d.ts +8 -3
- package/module/Math/standardDeviation.js +13 -7
- package/module/Math/standardDeviation.js.map +1 -1
- package/module/Math/subtract.d.ts +10 -4
- package/module/Math/subtract.js +12 -6
- package/module/Math/subtract.js.map +1 -1
- package/module/Math/toBaseN.d.ts +8 -6
- package/module/Math/toBaseN.js +9 -7
- package/module/Math/toBaseN.js.map +1 -1
- package/module/Math/toCelsius.d.ts +5 -3
- package/module/Math/toCelsius.js +5 -3
- package/module/Math/toCelsius.js.map +1 -1
- package/module/Math/toKelvin.d.ts +5 -3
- package/module/Math/toKelvin.js +5 -3
- package/module/Math/toKelvin.js.map +1 -1
- package/module/Math/uuidv7.d.ts +10 -2
- package/module/Math/uuidv7.js +10 -2
- package/module/Math/uuidv7.js.map +1 -1
- package/module/Math/valueSwap.d.ts +5 -4
- package/module/Math/valueSwap.js +5 -4
- package/module/Math/valueSwap.js.map +1 -1
- package/module/Math/xoshiro256.d.ts +8 -3
- package/module/Math/xoshiro256.js +8 -3
- package/module/Math/xoshiro256.js.map +1 -1
- package/module/Object/has.d.ts +4 -4
- package/module/Object/has.js +4 -4
- package/module/Object/keyBy.d.ts +3 -3
- package/module/Object/keyBy.js +4 -4
- package/module/Object/pick.d.ts +6 -6
- package/module/Object/pick.js +6 -6
- package/module/Object/pickDeep.d.ts +7 -7
- package/module/Object/pickDeep.js +7 -7
- package/module/Simple/Array/quickSortSimple.d.ts +9 -7
- package/module/Simple/Array/quickSortSimple.js +7 -6
- package/module/Simple/Array/quickSortSimple.js.map +1 -1
- package/module/Simple/Date/birthdaySimple.d.ts +4 -4
- package/module/Simple/Date/birthdaySimple.js +4 -4
- package/module/Simple/Date/dayOfWeekSimple.d.ts +4 -4
- package/module/Simple/Date/nowSimple.d.ts +3 -3
- package/module/Simple/Date/nowSimple.js +3 -3
- package/module/Simple/Math/deviationValueSimple.d.ts +10 -11
- package/module/Simple/Math/deviationValueSimple.js +14 -13
- package/module/Simple/Math/deviationValueSimple.js.map +1 -1
- package/module/String/deleteSpaces.d.ts +8 -4
- package/module/String/deleteSpaces.js +8 -4
- package/module/String/deleteSpaces.js.map +1 -1
- package/module/String/formatString.d.ts +8 -8
- package/module/String/formatString.js +7 -7
- package/module/String/formatString.js.map +1 -1
- package/module/String/fromBase64.d.ts +4 -3
- package/module/String/fromBase64.js +15 -9
- package/module/String/fromBase64.js.map +1 -1
- package/module/String/hasNoLetters.d.ts +9 -3
- package/module/String/hasNoLetters.js +12 -6
- package/module/String/hasNoLetters.js.map +1 -1
- package/module/String/padEnd.d.ts +5 -5
- package/module/String/padEnd.js +5 -5
- package/module/String/padStart.d.ts +11 -5
- package/module/String/padStart.js +17 -5
- package/module/String/padStart.js.map +1 -1
- package/module/String/randomString.d.ts +4 -4
- package/module/String/randomString.js +4 -4
- package/module/String/randomStringInitialization.d.ts +3 -3
- package/module/String/randomStringInitialization.js +3 -3
- package/module/String/reverseString.d.ts +3 -3
- package/module/String/reverseString.js +3 -3
- package/module/String/toBase64.d.ts +3 -3
- package/module/String/toBase64.js +3 -3
- package/module/String/toHalfWidth.d.ts +3 -3
- package/module/String/toHalfWidth.js +3 -3
- package/module/String/trimCharacters.d.ts +4 -4
- package/module/String/trimCharacters.js +4 -4
- package/module/String/trimEndCharacters.d.ts +10 -4
- package/module/String/trimEndCharacters.js +10 -4
- package/module/String/trimEndCharacters.js.map +1 -1
- package/module/String/trimStartCharacters.d.ts +10 -4
- package/module/String/trimStartCharacters.js +10 -4
- package/module/String/trimStartCharacters.js.map +1 -1
- package/module/Time/convertTime.d.ts +6 -6
- package/module/Time/convertTime.js +12 -11
- package/module/Time/convertTime.js.map +1 -1
- package/module/Tool/createPipeline.d.ts +8 -6
- package/module/Tool/createPipeline.js +6 -5
- package/module/Tool/createPipeline.js.map +1 -1
- package/module/Tool/parseJson.d.ts +7 -0
- package/module/Tool/parseJson.js +7 -0
- package/module/Tool/parseJson.js.map +1 -1
- package/module/UA/extractBrowserFromUserAgent.d.ts +12 -0
- package/module/UA/extractBrowserFromUserAgent.js +22 -5
- package/module/UA/extractBrowserFromUserAgent.js.map +1 -1
- package/module/UA/extractDeviceFromUserAgent.d.ts +12 -0
- package/module/UA/extractDeviceFromUserAgent.js +12 -0
- package/module/UA/extractDeviceFromUserAgent.js.map +1 -1
- package/module/UA/extractOsFromUserAgent.d.ts +12 -0
- package/module/UA/extractOsFromUserAgent.js +12 -0
- package/module/UA/extractOsFromUserAgent.js.map +1 -1
- package/module/UA/parseUserAgent.d.ts +16 -0
- package/module/UA/parseUserAgent.js +16 -0
- package/module/UA/parseUserAgent.js.map +1 -1
- package/module/Unit/index.d.ts +1 -0
- package/module/Unit/index.js +2 -0
- package/module/Unit/index.js.map +1 -0
- package/module/Unit/unitConverterInitialization.d.ts +16 -0
- package/module/Unit/unitConverterInitialization.js +19 -0
- package/module/Unit/unitConverterInitialization.js.map +1 -0
- package/module/Validate/array/core.d.ts +12 -0
- package/module/Validate/array/core.js +15 -3
- package/module/Validate/array/core.js.map +1 -1
- package/module/Validate/boolean/core.d.ts +9 -0
- package/module/Validate/boolean/core.js +9 -0
- package/module/Validate/boolean/core.js.map +1 -1
- package/module/Validate/core/index.d.ts +10 -0
- package/module/Validate/core/index.js +11 -1
- package/module/Validate/core/index.js.map +1 -1
- package/module/Validate/isArray.d.ts +3 -3
- package/module/Validate/isArray.js +3 -3
- package/module/Validate/isBrowser.d.ts +1 -1
- package/module/Validate/isBrowser.js +1 -1
- package/module/Validate/isBun.d.ts +1 -1
- package/module/Validate/isBun.js +1 -1
- package/module/Validate/isDictionaryObject.d.ts +3 -3
- package/module/Validate/isDictionaryObject.js +3 -3
- package/module/Validate/isDouble.d.ts +4 -4
- package/module/Validate/isDouble.js +4 -4
- package/module/Validate/isNode.d.ts +1 -1
- package/module/Validate/isNode.js +1 -1
- package/module/Validate/isNodeWebkit.d.ts +1 -1
- package/module/Validate/isNodeWebkit.js +1 -1
- package/module/Validate/isNotEmpty.d.ts +3 -3
- package/module/Validate/isNotEmpty.js +4 -4
- package/module/Validate/isNotEmpty.js.map +1 -1
- package/module/Validate/isNumber.d.ts +4 -4
- package/module/Validate/isNumber.js +10 -4
- package/module/Validate/isNumber.js.map +1 -1
- package/module/Validate/isPerfectSquare.d.ts +8 -3
- package/module/Validate/isPerfectSquare.js +8 -3
- package/module/Validate/isPerfectSquare.js.map +1 -1
- package/module/Validate/isPrimeNumber.d.ts +7 -3
- package/module/Validate/isPrimeNumber.js +8 -4
- package/module/Validate/isPrimeNumber.js.map +1 -1
- package/module/Validate/isValueNaN.d.ts +7 -5
- package/module/Validate/isValueNaN.js +7 -5
- package/module/Validate/isValueNaN.js.map +1 -1
- package/module/Validate/number/core.d.ts +11 -0
- package/module/Validate/number/core.js +11 -0
- package/module/Validate/number/core.js.map +1 -1
- package/module/Validate/number/double.d.ts +9 -0
- package/module/Validate/number/double.js +9 -0
- package/module/Validate/number/double.js.map +1 -1
- package/module/Validate/number/even.d.ts +9 -0
- package/module/Validate/number/even.js +9 -0
- package/module/Validate/number/even.js.map +1 -1
- package/module/Validate/number/maxValue.d.ts +10 -0
- package/module/Validate/number/maxValue.js +10 -0
- package/module/Validate/number/maxValue.js.map +1 -1
- package/module/Validate/number/minValue.d.ts +10 -0
- package/module/Validate/number/minValue.js +10 -0
- package/module/Validate/number/minValue.js.map +1 -1
- package/module/Validate/number/prime.d.ts +9 -0
- package/module/Validate/number/prime.js +9 -0
- package/module/Validate/number/prime.js.map +1 -1
- package/module/Validate/object/core.d.ts +11 -0
- package/module/Validate/object/core.js +11 -0
- package/module/Validate/object/core.js.map +1 -1
- package/module/Validate/string/core.d.ts +11 -0
- package/module/Validate/string/core.js +11 -0
- package/module/Validate/string/core.js.map +1 -1
- package/module/Validate/string/email.d.ts +9 -0
- package/module/Validate/string/email.js +10 -1
- package/module/Validate/string/email.js.map +1 -1
- package/module/Validate/string/length.d.ts +11 -0
- package/module/Validate/string/length.js +11 -0
- package/module/Validate/string/length.js.map +1 -1
- package/module/Validate/string/maxLength.d.ts +10 -0
- package/module/Validate/string/maxLength.js +10 -0
- package/module/Validate/string/maxLength.js.map +1 -1
- package/module/Validate/string/minLength.d.ts +10 -0
- package/module/Validate/string/minLength.js +10 -0
- package/module/Validate/string/minLength.js.map +1 -1
- package/module/Validate/string/numberString.d.ts +9 -0
- package/module/Validate/string/numberString.js +9 -0
- package/module/Validate/string/numberString.js.map +1 -1
- package/module/Validate/string/regexMatch.d.ts +10 -0
- package/module/Validate/string/regexMatch.js +10 -0
- package/module/Validate/string/regexMatch.js.map +1 -1
- package/module/Validate/string/uuid.d.ts +8 -3
- package/module/Validate/string/uuid.js +9 -4
- package/module/Validate/string/uuid.js.map +1 -1
- package/module/Validate/type.d.ts +22 -0
- package/module/es5/Advance/rangeAdvance.d.ts +10 -6
- package/module/es5/Advance/rangeAdvance.js +10 -6
- package/module/es5/Array/arraysJoin.d.ts +4 -4
- package/module/es5/Array/arraysJoin.js +4 -4
- package/module/es5/Array/binarySearch.d.ts +4 -3
- package/module/es5/Array/binarySearch.js +4 -3
- package/module/es5/Array/checkFlagAlignment.d.ts +3 -3
- package/module/es5/Array/checkFlagAlignment.js +7 -7
- package/module/es5/Array/chunk.d.ts +4 -4
- package/module/es5/Array/chunk.js +4 -4
- package/module/es5/Array/compact.d.ts +8 -0
- package/module/es5/Array/compact.js +8 -0
- package/module/es5/Array/compareFunctionDefault.d.ts +13 -0
- package/module/es5/Array/compareFunctionDefault.js +13 -0
- package/module/es5/Array/drop.d.ts +5 -5
- package/module/es5/Array/drop.js +5 -5
- package/module/es5/Array/dualPivotQuickSort.d.ts +16 -0
- package/module/es5/Array/dualPivotQuickSort.js +201 -0
- package/module/es5/Array/first.d.ts +3 -3
- package/module/es5/Array/first.js +3 -3
- package/module/es5/Array/generateNumberArray.d.ts +6 -6
- package/module/es5/Array/generateNumberArray.js +6 -6
- package/module/es5/Array/getArraysCommon.d.ts +4 -4
- package/module/es5/Array/getArraysCommon.js +4 -4
- package/module/es5/Array/getArraysDiff.d.ts +4 -4
- package/module/es5/Array/getArraysDiff.js +4 -4
- package/module/es5/Array/groupBy.d.ts +8 -4
- package/module/es5/Array/groupBy.js +8 -4
- package/module/es5/Array/index.d.ts +1 -0
- package/module/es5/Array/index.js +11 -0
- package/module/es5/Array/insertionSort.d.ts +8 -7
- package/module/es5/Array/insertionSort.js +6 -6
- package/module/es5/Array/mergeSort.d.ts +6 -5
- package/module/es5/Array/mergeSort.js +9 -9
- package/module/es5/Array/quickSort.d.ts +12 -11
- package/module/es5/Array/quickSort.js +47 -10
- package/module/es5/Array/randomSelect.d.ts +5 -5
- package/module/es5/Array/randomSelect.js +5 -5
- package/module/es5/Array/range.d.ts +5 -5
- package/module/es5/Array/range.js +28 -10
- package/module/es5/Array/shuffle.d.ts +3 -3
- package/module/es5/Array/shuffle.js +3 -3
- package/module/es5/Array/shuffle2DArray.d.ts +4 -4
- package/module/es5/Array/shuffle2DArray.js +6 -6
- package/module/es5/Array/sum.d.ts +3 -3
- package/module/es5/Array/sum.js +4 -4
- package/module/es5/Array/timSort.d.ts +13 -11
- package/module/es5/Array/timSort.js +36 -9
- package/module/es5/Array/zip.d.ts +6 -3
- package/module/es5/Array/zip.js +6 -3
- package/module/es5/Array/zipLongest.d.ts +8 -5
- package/module/es5/Array/zipLongest.js +8 -5
- package/module/es5/Color/cmykToRgba.d.ts +7 -7
- package/module/es5/Color/cmykToRgba.js +12 -12
- package/module/es5/Color/hexaToRgba.d.ts +4 -3
- package/module/es5/Color/hexaToRgba.js +18 -6
- package/module/es5/Color/hslaToRgba.d.ts +7 -6
- package/module/es5/Color/hslaToRgba.js +19 -13
- package/module/es5/Color/rgbaToCmyk.d.ts +3 -3
- package/module/es5/Color/rgbaToCmyk.js +7 -3
- package/module/es5/Color/rgbaToHexA.d.ts +4 -4
- package/module/es5/Color/rgbaToHexA.js +5 -5
- package/module/es5/Color/rgbaToHsla.d.ts +4 -3
- package/module/es5/Color/rgbaToHsla.js +8 -3
- package/module/es5/Consts/clock.d.ts +11 -11
- package/module/es5/Consts/clock.js +11 -11
- package/module/es5/Consts/httpStatus/httpClientErrorStatus.d.ts +28 -0
- package/module/es5/Consts/httpStatus/httpClientErrorStatus.js +28 -0
- package/module/es5/Consts/httpStatus/httpInformationalStatus.d.ts +9 -0
- package/module/es5/Consts/httpStatus/httpInformationalStatus.js +9 -0
- package/module/es5/Consts/httpStatus/httpRedirectionStatus.d.ts +11 -0
- package/module/es5/Consts/httpStatus/httpRedirectionStatus.js +11 -0
- package/module/es5/Consts/httpStatus/httpServerErrorStatus.d.ts +10 -0
- package/module/es5/Consts/httpStatus/httpServerErrorStatus.js +10 -0
- package/module/es5/Consts/httpStatus/httpSuccessStatus.d.ts +11 -0
- package/module/es5/Consts/httpStatus/httpSuccessStatus.js +11 -0
- package/module/es5/Date/birthday.d.ts +7 -6
- package/module/es5/Date/birthday.js +7 -6
- package/module/es5/Date/dateRange.d.ts +7 -4
- package/module/es5/Date/dateRange.js +7 -4
- package/module/es5/Date/dayOfWeek.d.ts +4 -4
- package/module/es5/Date/dayOfWeek.js +4 -4
- package/module/es5/Date/format.d.ts +30 -4
- package/module/es5/Date/format.js +30 -4
- package/module/es5/Date/getDay.d.ts +8 -5
- package/module/es5/Date/getDay.js +8 -5
- package/module/es5/Date/getTimezoneOffsetString.d.ts +3 -3
- package/module/es5/Date/getTimezoneOffsetString.js +3 -3
- package/module/es5/Date/isLeapYear.d.ts +8 -3
- package/module/es5/Date/isLeapYear.js +8 -3
- package/module/es5/Date/new.d.ts +20 -20
- package/module/es5/Date/new.js +21 -21
- package/module/es5/Date/now.d.ts +7 -4
- package/module/es5/Date/now.js +7 -4
- package/module/es5/Error/safeExecute.d.ts +21 -0
- package/module/es5/Error/safeExecute.js +36 -0
- package/module/es5/IP/cidrToLong.d.ts +4 -3
- package/module/es5/IP/cidrToLong.js +7 -3
- package/module/es5/IP/cidrToSubnetMask.d.ts +4 -3
- package/module/es5/IP/cidrToSubnetMask.js +4 -3
- package/module/es5/IP/getIpClass.d.ts +3 -3
- package/module/es5/IP/getIpClass.js +44 -18
- package/module/es5/IP/getNetworkAddress.d.ts +5 -4
- package/module/es5/IP/getNetworkAddress.js +35 -6
- package/module/es5/IP/ipToBinaryString.d.ts +4 -3
- package/module/es5/IP/ipToBinaryString.js +44 -5
- package/module/es5/IP/ipToLong.d.ts +4 -3
- package/module/es5/IP/ipToLong.js +4 -3
- package/module/es5/IP/isInRange.d.ts +6 -5
- package/module/es5/IP/isInRange.js +34 -7
- package/module/es5/IP/isPrivateIp.d.ts +4 -3
- package/module/es5/IP/isPrivateIp.js +30 -17
- package/module/es5/IP/longToIp.d.ts +4 -3
- package/module/es5/IP/longToIp.js +17 -5
- package/module/es5/IP/subnetMaskToCidr.d.ts +4 -3
- package/module/es5/IP/subnetMaskToCidr.js +33 -12
- package/module/es5/Math/addition.d.ts +3 -3
- package/module/es5/Math/addition.js +3 -3
- package/module/es5/Math/average.d.ts +7 -4
- package/module/es5/Math/average.js +7 -4
- package/module/es5/Math/bitwise.d.ts +5 -5
- package/module/es5/Math/bitwise.js +5 -5
- package/module/es5/Math/calculator/calculator.d.ts +9 -7
- package/module/es5/Math/calculator/calculator.js +9 -7
- package/module/es5/Math/calculator/calculatorInitialization.d.ts +4 -3
- package/module/es5/Math/calculator/calculatorInitialization.js +6 -5
- package/module/es5/Math/calculator/convertCurrency.d.ts +6 -4
- package/module/es5/Math/calculator/convertCurrency.js +6 -4
- package/module/es5/Math/calculator/core.js +13 -13
- package/module/es5/Math/calculator/literalExpression.d.ts +5 -3
- package/module/es5/Math/calculator/literalExpression.js +12 -10
- package/module/es5/Math/degToRad.d.ts +3 -3
- package/module/es5/Math/degToRad.js +3 -3
- package/module/es5/Math/deviationValue.d.ts +5 -5
- package/module/es5/Math/deviationValue.js +5 -5
- package/module/es5/Math/division.d.ts +5 -5
- package/module/es5/Math/division.js +35 -21
- package/module/es5/Math/factorial.d.ts +3 -3
- package/module/es5/Math/factorial.js +3 -3
- package/module/es5/Math/factorize.d.ts +3 -3
- package/module/es5/Math/factorize.js +3 -3
- package/module/es5/Math/flexibleNumberConversion.d.ts +11 -11
- package/module/es5/Math/flexibleNumberConversion.js +19 -19
- package/module/es5/Math/gcd.d.ts +5 -5
- package/module/es5/Math/gcd.js +6 -6
- package/module/es5/Math/getDecimalLength.d.ts +7 -4
- package/module/es5/Math/getDecimalLength.js +9 -5
- package/module/es5/Math/lcm.d.ts +4 -4
- package/module/es5/Math/lcm.js +5 -5
- package/module/es5/Math/linearCongruentialGenerator.d.ts +6 -6
- package/module/es5/Math/linearCongruentialGenerator.js +6 -6
- package/module/es5/Math/mathConverter.d.ts +7 -3
- package/module/es5/Math/mathConverter.js +7 -3
- package/module/es5/Math/mathSeparator.d.ts +8 -3
- package/module/es5/Math/mathSeparator.js +8 -3
- package/module/es5/Math/max.d.ts +4 -3
- package/module/es5/Math/max.js +4 -3
- package/module/es5/Math/median.d.ts +3 -3
- package/module/es5/Math/median.js +3 -3
- package/module/es5/Math/min.d.ts +4 -3
- package/module/es5/Math/min.js +4 -3
- package/module/es5/Math/multiples.d.ts +4 -4
- package/module/es5/Math/multiples.js +4 -4
- package/module/es5/Math/multiplication.d.ts +3 -3
- package/module/es5/Math/multiplication.js +3 -3
- package/module/es5/Math/nCr.d.ts +7 -4
- package/module/es5/Math/nCr.js +7 -4
- package/module/es5/Math/nHr.d.ts +7 -4
- package/module/es5/Math/nHr.js +7 -4
- package/module/es5/Math/nPr.d.ts +7 -4
- package/module/es5/Math/nPr.js +7 -4
- package/module/es5/Math/primeFactorization.d.ts +6 -3
- package/module/es5/Math/primeFactorization.js +11 -8
- package/module/es5/Math/quotient.d.ts +7 -4
- package/module/es5/Math/quotient.js +7 -4
- package/module/es5/Math/radToDeg.d.ts +5 -3
- package/module/es5/Math/radToDeg.js +5 -3
- package/module/es5/Math/random.d.ts +6 -5
- package/module/es5/Math/random.js +6 -5
- package/module/es5/Math/reduce.d.ts +9 -4
- package/module/es5/Math/reduce.js +14 -8
- package/module/es5/Math/repeatedTrial.d.ts +5 -5
- package/module/es5/Math/repeatedTrial.js +5 -5
- package/module/es5/Math/roundOf.d.ts +7 -5
- package/module/es5/Math/roundOf.js +8 -6
- package/module/es5/Math/solveEquation.d.ts +12 -13
- package/module/es5/Math/solveEquation.js +34 -38
- package/module/es5/Math/standardDeviation.d.ts +8 -3
- package/module/es5/Math/standardDeviation.js +16 -7
- package/module/es5/Math/subtract.d.ts +10 -4
- package/module/es5/Math/subtract.js +12 -6
- package/module/es5/Math/toBaseN.d.ts +8 -6
- package/module/es5/Math/toBaseN.js +9 -7
- package/module/es5/Math/toCelsius.d.ts +5 -3
- package/module/es5/Math/toCelsius.js +5 -3
- package/module/es5/Math/toKelvin.d.ts +5 -3
- package/module/es5/Math/toKelvin.js +5 -3
- package/module/es5/Math/uuidv7.d.ts +10 -2
- package/module/es5/Math/uuidv7.js +10 -2
- package/module/es5/Math/valueSwap.d.ts +5 -4
- package/module/es5/Math/valueSwap.js +5 -4
- package/module/es5/Math/xoshiro256.d.ts +8 -3
- package/module/es5/Math/xoshiro256.js +8 -3
- package/module/es5/Object/has.d.ts +4 -4
- package/module/es5/Object/has.js +4 -4
- package/module/es5/Object/keyBy.d.ts +3 -3
- package/module/es5/Object/keyBy.js +4 -4
- package/module/es5/Object/pick.d.ts +6 -6
- package/module/es5/Object/pick.js +6 -6
- package/module/es5/Object/pickDeep.d.ts +7 -7
- package/module/es5/Object/pickDeep.js +7 -7
- package/module/es5/Simple/Array/quickSortSimple.d.ts +9 -7
- package/module/es5/Simple/Array/quickSortSimple.js +7 -6
- package/module/es5/Simple/Date/birthdaySimple.d.ts +4 -4
- package/module/es5/Simple/Date/birthdaySimple.js +4 -4
- package/module/es5/Simple/Date/dayOfWeekSimple.d.ts +4 -4
- package/module/es5/Simple/Date/dayOfWeekSimple.js +4 -4
- package/module/es5/Simple/Date/nowSimple.d.ts +3 -3
- package/module/es5/Simple/Date/nowSimple.js +3 -3
- package/module/es5/Simple/Math/deviationValueSimple.d.ts +10 -11
- package/module/es5/Simple/Math/deviationValueSimple.js +23 -12
- package/module/es5/String/deleteSpaces.d.ts +8 -4
- package/module/es5/String/deleteSpaces.js +8 -4
- package/module/es5/String/formatString.d.ts +8 -8
- package/module/es5/String/formatString.js +7 -7
- package/module/es5/String/fromBase64.d.ts +4 -3
- package/module/es5/String/fromBase64.js +14 -9
- package/module/es5/String/hasNoLetters.d.ts +9 -3
- package/module/es5/String/hasNoLetters.js +12 -6
- package/module/es5/String/padEnd.d.ts +5 -5
- package/module/es5/String/padEnd.js +5 -5
- package/module/es5/String/padStart.d.ts +11 -5
- package/module/es5/String/padStart.js +20 -5
- package/module/es5/String/randomString.d.ts +4 -4
- package/module/es5/String/randomString.js +4 -4
- package/module/es5/String/randomStringInitialization.d.ts +3 -3
- package/module/es5/String/randomStringInitialization.js +3 -3
- package/module/es5/String/reverseString.d.ts +3 -3
- package/module/es5/String/reverseString.js +3 -3
- package/module/es5/String/toBase64.d.ts +3 -3
- package/module/es5/String/toBase64.js +3 -3
- package/module/es5/String/toHalfWidth.d.ts +3 -3
- package/module/es5/String/toHalfWidth.js +3 -3
- package/module/es5/String/trimCharacters.d.ts +4 -4
- package/module/es5/String/trimCharacters.js +4 -4
- package/module/es5/String/trimEndCharacters.d.ts +10 -4
- package/module/es5/String/trimEndCharacters.js +10 -4
- package/module/es5/String/trimStartCharacters.d.ts +10 -4
- package/module/es5/String/trimStartCharacters.js +10 -4
- package/module/es5/Time/convertTime.d.ts +6 -6
- package/module/es5/Time/convertTime.js +12 -11
- package/module/es5/Tool/createPipeline.d.ts +8 -6
- package/module/es5/Tool/createPipeline.js +10 -8
- package/module/es5/Tool/parseJson.d.ts +7 -0
- package/module/es5/Tool/parseJson.js +7 -0
- package/module/es5/UA/extractBrowserFromUserAgent.d.ts +12 -0
- package/module/es5/UA/extractBrowserFromUserAgent.js +22 -5
- package/module/es5/UA/extractDeviceFromUserAgent.d.ts +12 -0
- package/module/es5/UA/extractDeviceFromUserAgent.js +12 -0
- package/module/es5/UA/extractOsFromUserAgent.d.ts +12 -0
- package/module/es5/UA/extractOsFromUserAgent.js +12 -0
- package/module/es5/UA/parseUserAgent.d.ts +16 -0
- package/module/es5/UA/parseUserAgent.js +16 -0
- package/module/es5/Unit/index.d.ts +1 -0
- package/module/es5/Unit/index.js +16 -0
- package/module/es5/Unit/unitConverterInitialization.d.ts +16 -0
- package/module/es5/Unit/unitConverterInitialization.js +28 -0
- package/module/es5/Validate/array/core.d.ts +12 -0
- package/module/es5/Validate/array/core.js +15 -4
- package/module/es5/Validate/boolean/core.d.ts +9 -0
- package/module/es5/Validate/boolean/core.js +10 -0
- package/module/es5/Validate/core/index.d.ts +10 -0
- package/module/es5/Validate/core/index.js +13 -1
- package/module/es5/Validate/isArray.d.ts +3 -3
- package/module/es5/Validate/isArray.js +3 -3
- package/module/es5/Validate/isBrowser.d.ts +1 -1
- package/module/es5/Validate/isBrowser.js +1 -1
- package/module/es5/Validate/isBun.d.ts +1 -1
- package/module/es5/Validate/isBun.js +1 -1
- package/module/es5/Validate/isDictionaryObject.d.ts +3 -3
- package/module/es5/Validate/isDictionaryObject.js +3 -3
- package/module/es5/Validate/isDouble.d.ts +4 -4
- package/module/es5/Validate/isDouble.js +4 -4
- package/module/es5/Validate/isNode.d.ts +1 -1
- package/module/es5/Validate/isNode.js +1 -1
- package/module/es5/Validate/isNodeWebkit.d.ts +1 -1
- package/module/es5/Validate/isNodeWebkit.js +1 -1
- package/module/es5/Validate/isNotEmpty.d.ts +3 -3
- package/module/es5/Validate/isNotEmpty.js +4 -4
- package/module/es5/Validate/isNumber.d.ts +4 -4
- package/module/es5/Validate/isNumber.js +11 -4
- package/module/es5/Validate/isPerfectSquare.d.ts +8 -3
- package/module/es5/Validate/isPerfectSquare.js +8 -3
- package/module/es5/Validate/isPrimeNumber.d.ts +7 -3
- package/module/es5/Validate/isPrimeNumber.js +8 -4
- package/module/es5/Validate/isValueNaN.d.ts +7 -5
- package/module/es5/Validate/isValueNaN.js +7 -5
- package/module/es5/Validate/number/core.d.ts +11 -0
- package/module/es5/Validate/number/core.js +12 -0
- package/module/es5/Validate/number/double.d.ts +9 -0
- package/module/es5/Validate/number/double.js +10 -0
- package/module/es5/Validate/number/even.d.ts +9 -0
- package/module/es5/Validate/number/even.js +10 -0
- package/module/es5/Validate/number/maxValue.d.ts +10 -0
- package/module/es5/Validate/number/maxValue.js +11 -0
- package/module/es5/Validate/number/minValue.d.ts +10 -0
- package/module/es5/Validate/number/minValue.js +11 -0
- package/module/es5/Validate/number/prime.d.ts +9 -0
- package/module/es5/Validate/number/prime.js +10 -0
- package/module/es5/Validate/object/core.d.ts +11 -0
- package/module/es5/Validate/object/core.js +12 -0
- package/module/es5/Validate/string/core.d.ts +11 -0
- package/module/es5/Validate/string/core.js +12 -0
- package/module/es5/Validate/string/email.d.ts +9 -0
- package/module/es5/Validate/string/email.js +11 -1
- package/module/es5/Validate/string/length.d.ts +11 -0
- package/module/es5/Validate/string/length.js +12 -0
- package/module/es5/Validate/string/maxLength.d.ts +10 -0
- package/module/es5/Validate/string/maxLength.js +11 -0
- package/module/es5/Validate/string/minLength.d.ts +10 -0
- package/module/es5/Validate/string/minLength.js +11 -0
- package/module/es5/Validate/string/numberString.d.ts +9 -0
- package/module/es5/Validate/string/numberString.js +10 -0
- package/module/es5/Validate/string/regexMatch.d.ts +10 -0
- package/module/es5/Validate/string/regexMatch.js +11 -0
- package/module/es5/Validate/string/uuid.d.ts +8 -3
- package/module/es5/Validate/string/uuid.js +10 -4
- package/module/es5/Validate/type.d.ts +22 -0
- package/module/es5/index.d.ts +1 -0
- package/module/es5/index.js +11 -0
- package/module/es5/tests/integration/Array/drop-and-first.test.js +20 -0
- package/module/es5/tests/integration/Tool/parseJson-and-Validate.test.js +68 -14
- package/module/es5/tests/unit/Array/arraysJoin.test.js +15 -3
- package/module/es5/tests/unit/Array/checkFlagAlignment.test.js +10 -10
- package/module/es5/tests/unit/Array/compact.test.js +17 -17
- package/module/es5/tests/unit/Array/compareFunctionDefault.test.d.ts +1 -0
- package/module/es5/tests/unit/Array/compareFunctionDefault.test.js +29 -0
- package/module/es5/tests/unit/Array/drop.test.js +10 -10
- package/module/es5/tests/unit/Array/dualPivotQuickSort.test.d.ts +1 -0
- package/module/es5/tests/unit/Array/dualPivotQuickSort.test.js +87 -0
- package/module/es5/tests/unit/Array/generateNumberArray.test.js +6 -6
- package/module/es5/tests/unit/Array/getArraysCommon.test.js +36 -4
- package/module/es5/tests/unit/Array/getArraysDiff.test.js +14 -14
- package/module/es5/tests/unit/Array/groupBy.test.js +6 -6
- package/module/es5/tests/unit/Array/insertionSort.test.js +8 -8
- package/module/es5/tests/unit/Array/mergeSort.test.js +34 -5
- package/module/es5/tests/unit/Array/quickSort.test.js +76 -11
- package/module/es5/tests/unit/Array/randomSelect.test.js +11 -6
- package/module/es5/tests/unit/Array/range.test.js +25 -4
- package/module/es5/tests/unit/Array/shuffle.test.js +53 -6
- package/module/es5/tests/unit/Array/shuffle2DArray.test.js +51 -8
- package/module/es5/tests/unit/Array/sum.test.js +40 -2
- package/module/es5/tests/unit/Array/timSort.test.js +89 -9
- package/module/es5/tests/unit/Array/zip.test.js +48 -9
- package/module/es5/tests/unit/Array/zipLongest.test.js +52 -9
- package/module/es5/tests/unit/Color/cmykToRgba.test.js +3 -3
- package/module/es5/tests/unit/Color/hexaToRgba.test.js +53 -1
- package/module/es5/tests/unit/Color/hslaToRgba.test.js +35 -53
- package/module/es5/tests/unit/Color/rgbaToCmyk.test.js +67 -1
- package/module/es5/tests/unit/Color/rgbaToHsla.test.js +91 -1
- package/module/es5/tests/unit/Consts/clock.test.js +51 -18
- package/module/es5/tests/unit/Consts/httpStatus.test.js +9 -0
- package/module/es5/tests/unit/Date/birthday.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/birthday.test.js +31 -0
- package/module/es5/tests/unit/Date/dateRange.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/dateRange.test.js +40 -0
- package/module/es5/tests/unit/Date/dayOfWeek.test.js +5 -5
- package/module/es5/tests/unit/Date/format.test.js +22 -0
- package/module/es5/tests/unit/Date/getDay.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/getDay.test.js +40 -0
- package/module/es5/tests/unit/Date/getTimezoneOffsetString.test.js +3 -3
- package/module/es5/tests/unit/Date/isLeapYear.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/isLeapYear.test.js +30 -0
- package/module/es5/tests/unit/Date/new.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/new.test.js +39 -0
- package/module/es5/tests/unit/Date/now.test.d.ts +1 -0
- package/module/es5/tests/unit/Date/now.test.js +42 -0
- package/module/es5/tests/unit/Error/safeExecute.test.js +69 -15
- package/module/es5/tests/unit/IP/cidrToLong.test.js +27 -5
- package/module/es5/tests/unit/IP/cidrToSubnetMask.test.js +29 -10
- package/module/es5/tests/unit/IP/getIpClass.test.js +29 -18
- package/module/es5/tests/unit/IP/getNetworkAddress.test.js +35 -14
- package/module/es5/tests/unit/IP/ipToBinaryString.test.js +38 -9
- package/module/es5/tests/unit/IP/ipToLong.test.js +27 -13
- package/module/es5/tests/unit/IP/isInRange.test.js +75 -4
- package/module/es5/tests/unit/IP/isPrivateIp.test.js +18 -12
- package/module/es5/tests/unit/IP/longToIp.test.d.ts +1 -0
- package/module/es5/tests/unit/IP/longToIp.test.js +39 -0
- package/module/es5/tests/unit/IP/subnetMaskToCidr.test.js +34 -20
- package/module/es5/tests/unit/Math/average.test.js +40 -18
- package/module/es5/tests/unit/Math/bitwise.test.js +14 -14
- package/module/es5/tests/unit/Math/calculator/calculator.test.js +9 -9
- package/module/es5/tests/unit/Math/calculator/calculatorInitialization.test.js +16 -5
- package/module/es5/tests/unit/Math/calculator/convertCurrency.test.js +12 -12
- package/module/es5/tests/unit/Math/calculator/literalExpression.test.js +8 -8
- package/module/es5/tests/unit/Math/degToRad.test.js +10 -10
- package/module/es5/tests/unit/Math/deviationValue.test.js +12 -12
- package/module/es5/tests/unit/Math/division.test.js +72 -25
- package/module/es5/tests/unit/Math/factorial.test.js +4 -4
- package/module/es5/tests/unit/Math/factorize.test.js +34 -9
- package/module/es5/tests/unit/Math/flexibleNumberConversion.test.js +75 -75
- package/module/es5/tests/unit/Math/gcd.test.js +5 -5
- package/module/es5/tests/unit/Math/getDecimalLength.test.js +40 -4
- package/module/es5/tests/unit/Math/lcm.test.js +16 -9
- package/module/es5/tests/unit/Math/linearCongruentialGenerator.test.js +4 -4
- package/module/es5/tests/unit/Math/mathConverter.test.js +13 -13
- package/module/es5/tests/unit/Math/mathSeparator.test.js +23 -5
- package/module/es5/tests/unit/Math/max.test.js +18 -3
- package/module/es5/tests/unit/Math/median.test.js +4 -4
- package/module/es5/tests/unit/Math/min.test.js +18 -3
- package/module/es5/tests/unit/Math/multiples.test.js +26 -10
- package/module/es5/tests/unit/Math/multiplication.test.js +43 -9
- package/module/es5/tests/unit/Math/nCr.test.js +27 -14
- package/module/es5/tests/unit/Math/nHr.test.js +28 -15
- package/module/es5/tests/unit/Math/nPr.test.js +31 -14
- package/module/es5/tests/unit/Math/primeFactorization.test.js +79 -8
- package/module/es5/tests/unit/Math/quotient.test.js +32 -10
- package/module/es5/tests/unit/Math/radToDeg.test.js +39 -38
- package/module/es5/tests/unit/Math/random.test.js +55 -17
- package/module/es5/tests/unit/Math/reduce.test.js +87 -8
- package/module/es5/tests/unit/Math/repeatedTrial.test.js +35 -5
- package/module/es5/tests/unit/Math/roundOf.test.js +36 -11
- package/module/es5/tests/unit/Math/solveEquation.test.js +20 -20
- package/module/es5/tests/unit/Math/standardDeviation.test.js +19 -2
- package/module/es5/tests/unit/Math/subtract.test.js +14 -2
- package/module/es5/tests/unit/Math/toBaseN.test.js +36 -19
- package/module/es5/tests/unit/Math/toCelsius.test.js +14 -2
- package/module/es5/tests/unit/Math/toKelvin.test.js +14 -2
- package/module/es5/tests/unit/Math/uuidv7.test.js +6 -6
- package/module/es5/tests/unit/Math/valueSwap.test.js +24 -6
- package/module/es5/tests/unit/Math/xoshiro256.test.js +22 -11
- package/module/es5/tests/unit/Object/keyBy.test.js +6 -6
- package/module/es5/tests/unit/Object/pick.test.js +11 -11
- package/module/es5/tests/unit/Object/pickDeep.test.js +15 -15
- package/module/es5/tests/unit/Simple/Array/quickSortSimple.test.js +4 -4
- package/module/es5/tests/unit/Simple/Math/deviationValueSimple.test.js +39 -3
- package/module/es5/tests/unit/String/deleteSpaces.test.d.ts +1 -0
- package/module/es5/tests/unit/String/deleteSpaces.test.js +22 -0
- package/module/es5/tests/unit/String/formatString.test.js +41 -14
- package/module/es5/tests/unit/String/fromBase64.test.js +19 -8
- package/module/es5/tests/unit/String/hasNoLetters.test.js +20 -24
- package/module/es5/tests/unit/String/padEnd.test.js +5 -5
- package/module/es5/tests/unit/String/padStart.test.js +32 -19
- package/module/es5/tests/unit/String/randomString.test.js +3 -3
- package/module/es5/tests/unit/String/randomStringInitialization.test.js +2 -2
- package/module/es5/tests/unit/String/reverseString.test.js +10 -12
- package/module/es5/tests/unit/String/toBase64.test.js +5 -5
- package/module/es5/tests/unit/String/toHalfWidth.test.js +3 -3
- package/module/es5/tests/unit/String/trimCharacters.test.js +4 -4
- package/module/es5/tests/unit/String/trimEndCharacters.test.js +17 -7
- package/module/es5/tests/unit/String/trimStartCharacters.test.js +23 -10
- package/module/es5/tests/unit/Time/convertTime.test.js +40 -46
- package/module/es5/tests/unit/Tool/createPipeline.test.js +15 -15
- package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.d.ts +1 -0
- package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.js +47 -0
- package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.d.ts +1 -0
- package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.js +55 -0
- package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.d.ts +1 -0
- package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.js +57 -0
- package/module/es5/tests/unit/Unit/unitConverterInitialization.test.d.ts +1 -0
- package/module/es5/tests/unit/Unit/unitConverterInitialization.test.js +40 -0
- package/module/es5/tests/unit/Validate/array/core.test.js +39 -10
- package/module/es5/tests/unit/Validate/core/core.test.d.ts +1 -0
- package/module/es5/tests/unit/Validate/core/core.test.js +87 -0
- package/module/es5/tests/unit/Validate/isArray.test.js +11 -0
- package/module/es5/tests/unit/Validate/isDictionaryObject.test.js +15 -1
- package/module/es5/tests/unit/Validate/isDouble.test.js +21 -4
- package/module/es5/tests/unit/Validate/isNotEmpty.test.js +3 -3
- package/module/es5/tests/unit/Validate/isNumber.test.js +67 -29
- package/module/es5/tests/unit/Validate/isPerfectSquare.test.js +5 -0
- package/module/es5/tests/unit/Validate/isPrimeNumber.test.js +14 -4
- package/module/es5/tests/unit/Validate/isValueNaN.test.js +50 -11
- package/module/es5/tests/unit/Validate/string/uuid.test.js +13 -13
- package/module/es5/tsconfig.tsbuildinfo +1 -1
- package/module/es5/types/array/compareFunction.d.ts +2 -0
- package/module/es5/types/array/compareFunction.js +5 -0
- package/module/es5/types/time/timeUnit.d.ts +1 -1
- package/module/index.d.ts +1 -0
- package/module/index.js +1 -0
- package/module/index.js.map +1 -1
- package/module/types/array/compareFunction.d.ts +2 -0
- package/module/types/array/compareFunction.js +2 -0
- package/module/types/array/compareFunction.js.map +1 -0
- package/module/types/time/timeUnit.d.ts +1 -1
- package/package.json +14 -14
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param start
|
|
4
|
-
* @param end
|
|
5
|
-
* @param conditionalExpression
|
|
6
|
-
* @returns
|
|
7
|
-
*
|
|
2
|
+
* Returns an array of numbers that satisfy the conditional expression
|
|
3
|
+
* @param start - Starting number
|
|
4
|
+
* @param end - Ending number (exclusive)
|
|
5
|
+
* @param conditionalExpression - Function that determines which numbers to include
|
|
6
|
+
* @returns Array of numbers that satisfy the conditional expression
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* rangeAdvance(1, 10, (number) => number % 2 === 0); // [2, 4, 6, 8]
|
|
11
|
+
* ```
|
|
8
12
|
*/
|
|
9
13
|
declare const rangeAdvance: (start: number, end?: number, conditionalExpression?: (number_: number) => boolean) => number[];
|
|
10
14
|
export { rangeAdvance };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { range } from "../Array/range";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param start
|
|
5
|
-
* @param end
|
|
6
|
-
* @param conditionalExpression
|
|
7
|
-
* @returns
|
|
8
|
-
*
|
|
3
|
+
* Returns an array of numbers that satisfy the conditional expression
|
|
4
|
+
* @param start - Starting number
|
|
5
|
+
* @param end - Ending number (exclusive)
|
|
6
|
+
* @param conditionalExpression - Function that determines which numbers to include
|
|
7
|
+
* @returns Array of numbers that satisfy the conditional expression
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* rangeAdvance(1, 10, (number) => number % 2 === 0); // [2, 4, 6, 8]
|
|
12
|
+
* ```
|
|
9
13
|
*/
|
|
10
14
|
const rangeAdvance = (start, end, conditionalExpression) => {
|
|
11
15
|
if (conditionalExpression) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rangeAdvance.js","sourceRoot":"","sources":["../../src/Advance/rangeAdvance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"rangeAdvance.js","sourceRoot":"","sources":["../../src/Advance/rangeAdvance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,MAAM,YAAY,GAAG,CACnB,KAAa,EACb,GAAY,EACZ,qBAAoD,EAC1C,EAAE;IACZ,IAAI,qBAAqB,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,IAAI,KAAK,GAAG,KAAK,EAAE,KAAK,GAAI,GAAc,EAAE,KAAK,EAAE,EAAE,CAAC;YACzD,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC;gBACjC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC3B,CAAC,CAAC;AACF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {unknown[]} array
|
|
4
|
-
* @param {unknown[]} arrays
|
|
5
|
-
* @returns unknown[]
|
|
2
|
+
* Join arrays without duplicates
|
|
3
|
+
* @param {unknown[]} array - First array to join
|
|
4
|
+
* @param {unknown[]} arrays - Additional arrays to join
|
|
5
|
+
* @returns {unknown[]} Array with unique elements from all input arrays
|
|
6
6
|
* @example arraysJoin([1, 2, 3], [2, 3, 4]); // [1, 2, 3, 4]
|
|
7
7
|
*/
|
|
8
8
|
export declare const arraysJoin: <A extends unknown[]>(array: unknown[], ...arrays: unknown[]) => A;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {unknown[]} array
|
|
4
|
-
* @param {unknown[]} arrays
|
|
5
|
-
* @returns unknown[]
|
|
2
|
+
* Join arrays without duplicates
|
|
3
|
+
* @param {unknown[]} array - First array to join
|
|
4
|
+
* @param {unknown[]} arrays - Additional arrays to join
|
|
5
|
+
* @returns {unknown[]} Array with unique elements from all input arrays
|
|
6
6
|
* @example arraysJoin([1, 2, 3], [2, 3, 4]); // [1, 2, 3, 4]
|
|
7
7
|
*/
|
|
8
8
|
export const arraysJoin = (array, ...arrays) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param
|
|
4
|
-
* @param target
|
|
2
|
+
* Binary search implementation
|
|
3
|
+
* @param array A sorted array of numbers
|
|
4
|
+
* @param target The value to search for
|
|
5
|
+
* @returns The index of the target value in the array, or -1 if not found
|
|
5
6
|
*/
|
|
6
7
|
export declare const binarySearch: (array: number[], target: number) => number;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param
|
|
4
|
-
* @param target
|
|
2
|
+
* Binary search implementation
|
|
3
|
+
* @param array A sorted array of numbers
|
|
4
|
+
* @param target The value to search for
|
|
5
|
+
* @returns The index of the target value in the array, or -1 if not found
|
|
5
6
|
*/
|
|
6
7
|
export const binarySearch = (array, target) => {
|
|
7
8
|
let left = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binarySearch.js","sourceRoot":"","sources":["../../src/Array/binarySearch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"binarySearch.js","sourceRoot":"","sources":["../../src/Array/binarySearch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAe,EAAE,MAAc,EAAU,EAAE;IACtE,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAE7B,OAAO,IAAI,IAAI,KAAK,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAE5B,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;YACxB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;YACtB,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param matrix
|
|
4
|
-
* @returns
|
|
2
|
+
* Check if flags are aligned in any direction (horizontal, vertical, or diagonal)
|
|
3
|
+
* @param matrix Two-dimensional array of cells containing flags
|
|
4
|
+
* @returns True if flags are aligned in any direction, false otherwise
|
|
5
5
|
* @example checkFlagAlignment([
|
|
6
6
|
* [{ value: 1, flag: true }, { value: 2, flag: false }, { value: 3, flag: true }],
|
|
7
7
|
* [{ value: 4, flag: false }, { value: 5, flag: true }, { value: 6, flag: false }],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param matrix
|
|
4
|
-
* @returns
|
|
2
|
+
* Check if flags are aligned in any direction (horizontal, vertical, or diagonal)
|
|
3
|
+
* @param matrix Two-dimensional array of cells containing flags
|
|
4
|
+
* @returns True if flags are aligned in any direction, false otherwise
|
|
5
5
|
* @example checkFlagAlignment([
|
|
6
6
|
* [{ value: 1, flag: true }, { value: 2, flag: false }, { value: 3, flag: true }],
|
|
7
7
|
* [{ value: 4, flag: false }, { value: 5, flag: true }, { value: 6, flag: false }],
|
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
export const checkFlagAlignment = (matrix) => {
|
|
12
12
|
const rows = matrix.length;
|
|
13
13
|
const cols = matrix[0].length;
|
|
14
|
-
//
|
|
14
|
+
// Check horizontal alignment
|
|
15
15
|
for (let index = 0; index < rows; index++) {
|
|
16
16
|
if (matrix[index].every((cell) => cell.flag)) {
|
|
17
17
|
return true;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
//
|
|
20
|
+
// Check vertical alignment
|
|
21
21
|
for (let index = 0; index < cols; index++) {
|
|
22
22
|
if (matrix.every((row) => row[index].flag)) {
|
|
23
23
|
return true;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
//
|
|
26
|
+
// Check diagonal alignment (top-left to bottom-right)
|
|
27
27
|
if (matrix.every((row, index) => row[index].flag)) {
|
|
28
28
|
return true;
|
|
29
29
|
}
|
|
30
|
-
//
|
|
30
|
+
// Check diagonal alignment (bottom-left to top-right)
|
|
31
31
|
if (matrix.every((row, index) => row[cols - index - 1].flag)) {
|
|
32
32
|
return true;
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFlagAlignment.js","sourceRoot":"","sources":["../../src/Array/checkFlagAlignment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,MAAa,EACJ,EAAE;IACX,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE9B,
|
|
1
|
+
{"version":3,"file":"checkFlagAlignment.js","sourceRoot":"","sources":["../../src/Array/checkFlagAlignment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,MAAa,EACJ,EAAE;IACX,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE9B,6BAA6B;IAC7B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC1C,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,2BAA2B;IAC3B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC1C,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3C,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,sDAAsD;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sDAAsD;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
package/module/Array/chunk.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ChunkArrayType } from "../types/array/chunk"; /**
|
|
2
|
-
*
|
|
3
|
-
* @param {T} array
|
|
4
|
-
* @param {N} n
|
|
5
|
-
* @returns
|
|
2
|
+
* Split an array into smaller chunks of specified size
|
|
3
|
+
* @param {T} array The array to split
|
|
4
|
+
* @param {N} n The size of each chunk
|
|
5
|
+
* @returns Array of chunks
|
|
6
6
|
* @example chunk([1, 2, 3, 4, 5, 6, 7, 8, 9], 3); // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
|
|
7
7
|
*/
|
|
8
8
|
export declare const chunk: <T extends unknown[], N extends number>(array: T, n: N) => ChunkArrayType<T, N>;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates an array with all falsey values removed
|
|
3
|
+
* @param {T[]} array The array to compact
|
|
4
|
+
* @returns {T[]} Returns the new array of filtered values
|
|
5
|
+
* @example
|
|
6
|
+
* compact([0, 1, false, 2, '', 3]); // [1, 2, 3]
|
|
7
|
+
* compact([null, undefined, NaN, 0, false, '']); // []
|
|
8
|
+
*/
|
|
1
9
|
export declare const compact: <T>(array: T[]) => T[];
|
package/module/Array/compact.js
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates an array with all falsey values removed
|
|
3
|
+
* @param {T[]} array The array to compact
|
|
4
|
+
* @returns {T[]} Returns the new array of filtered values
|
|
5
|
+
* @example
|
|
6
|
+
* compact([0, 1, false, 2, '', 3]); // [1, 2, 3]
|
|
7
|
+
* compact([null, undefined, NaN, 0, false, '']); // []
|
|
8
|
+
*/
|
|
1
9
|
export const compact = (array) => array.filter(Boolean);
|
|
2
10
|
//# sourceMappingURL=compact.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact.js","sourceRoot":"","sources":["../../src/Array/compact.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,KAAU,EAAO,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"compact.js","sourceRoot":"","sources":["../../src/Array/compact.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,KAAU,EAAO,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAQ,CAAC"}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default comparison function that returns:
|
|
3
|
+
* - 1 if a > b
|
|
4
|
+
* - -1 if a < b
|
|
5
|
+
* - 0 if a equals b
|
|
6
|
+
* @param {T} a First value to compare
|
|
7
|
+
* @param {T} b Second value to compare
|
|
8
|
+
* @returns {number} Comparison result (-1, 0, or 1)
|
|
9
|
+
* @example
|
|
10
|
+
* compareFunctionDefault(2, 1); // 1
|
|
11
|
+
* compareFunctionDefault(1, 2); // -1
|
|
12
|
+
* compareFunctionDefault(2, 2); // 0
|
|
13
|
+
*/
|
|
1
14
|
export declare const compareFunctionDefault: <T>(a: T, b: T) => number;
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default comparison function that returns:
|
|
3
|
+
* - 1 if a > b
|
|
4
|
+
* - -1 if a < b
|
|
5
|
+
* - 0 if a equals b
|
|
6
|
+
* @param {T} a First value to compare
|
|
7
|
+
* @param {T} b Second value to compare
|
|
8
|
+
* @returns {number} Comparison result (-1, 0, or 1)
|
|
9
|
+
* @example
|
|
10
|
+
* compareFunctionDefault(2, 1); // 1
|
|
11
|
+
* compareFunctionDefault(1, 2); // -1
|
|
12
|
+
* compareFunctionDefault(2, 2); // 0
|
|
13
|
+
*/
|
|
1
14
|
export const compareFunctionDefault = (a, b) => a > b ? 1 : a < b ? -1 : 0;
|
|
2
15
|
//# sourceMappingURL=compareFunctionDefault.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareFunctionDefault.js","sourceRoot":"","sources":["../../src/Array/compareFunctionDefault.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAI,CAAI,EAAE,CAAI,EAAU,EAAE,CAC9D,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"compareFunctionDefault.js","sourceRoot":"","sources":["../../src/Array/compareFunctionDefault.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAI,CAAI,EAAE,CAAI,EAAU,EAAE,CAC9D,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/module/Array/drop.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {T[]} array
|
|
4
|
-
* @param {number} n
|
|
5
|
-
* @param {"left" | "right" | "between"} direction
|
|
6
|
-
* @returns n
|
|
2
|
+
* Returns a new array with n elements removed from the specified direction
|
|
3
|
+
* @param {T[]} array The target array
|
|
4
|
+
* @param {number} n The number of elements to remove
|
|
5
|
+
* @param {"left" | "right" | "between"} direction The direction to remove elements from
|
|
6
|
+
* @returns A new array with n elements removed
|
|
7
7
|
*
|
|
8
8
|
* @example drop([1, 2, 3, 4, 5], 2); // [3, 4, 5]
|
|
9
9
|
* @example drop([1, 2, 3, 4, 5], 2, "left"); // [3, 4, 5]
|
package/module/Array/drop.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {T[]} array
|
|
4
|
-
* @param {number} n
|
|
5
|
-
* @param {"left" | "right" | "between"} direction
|
|
6
|
-
* @returns n
|
|
2
|
+
* Returns a new array with n elements removed from the specified direction
|
|
3
|
+
* @param {T[]} array The target array
|
|
4
|
+
* @param {number} n The number of elements to remove
|
|
5
|
+
* @param {"left" | "right" | "between"} direction The direction to remove elements from
|
|
6
|
+
* @returns A new array with n elements removed
|
|
7
7
|
*
|
|
8
8
|
* @example drop([1, 2, 3, 4, 5], 2); // [3, 4, 5]
|
|
9
9
|
* @example drop([1, 2, 3, 4, 5], 2, "left"); // [3, 4, 5]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type CompareFunction<T> = (a: T, b: T) => number;
|
|
2
|
+
/**
|
|
3
|
+
* Sort array using dual-pivot quicksort algorithm
|
|
4
|
+
* More efficient than traditional quicksort for arrays with many duplicate values
|
|
5
|
+
* @param array - Array to be sorted
|
|
6
|
+
* @param compareFunction - Optional comparison function
|
|
7
|
+
* @param startIndex - Optional starting index (default: 0)
|
|
8
|
+
* @param endIndex - Optional ending index (default: array.length - 1)
|
|
9
|
+
* @param insertionSortThreshold - Optional threshold for insertion sort (default: 10)
|
|
10
|
+
* @returns Sorted array
|
|
11
|
+
* @example
|
|
12
|
+
* dualPivotQuickSort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3]); // [1, 1, 2, 3, 3, 4, 5, 5, 6, 9]
|
|
13
|
+
* dualPivotQuickSort(['banana', 'apple', 'orange']); // ['apple', 'banana', 'orange']
|
|
14
|
+
*/
|
|
15
|
+
export declare const dualPivotQuickSort: <T>(array: T[], compareFunction?: CompareFunction<T>, startIndex?: number, endIndex?: number, insertionSortThreshold?: number) => T[];
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { compareFunctionDefault } from "./compareFunctionDefault";
|
|
2
|
+
/**
|
|
3
|
+
* Get the median of three elements in the array
|
|
4
|
+
* @param array - The input array
|
|
5
|
+
* @param a - Index of the first element
|
|
6
|
+
* @param b - Index of the second element
|
|
7
|
+
* @param c - Index of the third element
|
|
8
|
+
* @param compareFunction - Comparison function
|
|
9
|
+
* @returns Index of the median element
|
|
10
|
+
*/
|
|
11
|
+
const medianOfThree = (array, a, b, c, compareFunction) => {
|
|
12
|
+
// Return the index of the median value
|
|
13
|
+
const values = [
|
|
14
|
+
{ index: a, value: array[a] },
|
|
15
|
+
{ index: b, value: array[b] },
|
|
16
|
+
{ index: c, value: array[c] },
|
|
17
|
+
];
|
|
18
|
+
// Sort and return the middle element's index
|
|
19
|
+
values.sort((x, y) => compareFunction(x.value, y.value));
|
|
20
|
+
return values[1].index;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Select dual pivots and partition the array into three parts
|
|
24
|
+
* @param array - Array to be partitioned
|
|
25
|
+
* @param low - Starting index
|
|
26
|
+
* @param high - Ending index
|
|
27
|
+
* @param compareFunction - Comparison function
|
|
28
|
+
* @returns Object containing left and right pivot indices
|
|
29
|
+
*/
|
|
30
|
+
const partition = (array, low, high, compareFunction) => {
|
|
31
|
+
// Select pivot candidates
|
|
32
|
+
const length = high - low;
|
|
33
|
+
const gap = Math.max(1, Math.floor(length / 3));
|
|
34
|
+
// Find optimal pivot positions
|
|
35
|
+
const leftPivotIndex = medianOfThree(array, low, low + gap, Math.min(low + 2 * gap, high), compareFunction);
|
|
36
|
+
const rightPivotIndex = medianOfThree(array, Math.max(low, high - 2 * gap), high - gap, high, compareFunction);
|
|
37
|
+
// Move pivots to ends
|
|
38
|
+
if (leftPivotIndex !== low) {
|
|
39
|
+
[array[low], array[leftPivotIndex]] = [array[leftPivotIndex], array[low]];
|
|
40
|
+
}
|
|
41
|
+
if (rightPivotIndex !== high) {
|
|
42
|
+
[array[high], array[rightPivotIndex]] = [
|
|
43
|
+
array[rightPivotIndex],
|
|
44
|
+
array[high],
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
// Swap pivots if needed
|
|
48
|
+
if (compareFunction(array[low], array[high]) > 0) {
|
|
49
|
+
[array[low], array[high]] = [array[high], array[low]];
|
|
50
|
+
}
|
|
51
|
+
// Initialize partition boundaries
|
|
52
|
+
let left = low + 1;
|
|
53
|
+
let right = high - 1;
|
|
54
|
+
let current = left;
|
|
55
|
+
// Partition into three parts
|
|
56
|
+
while (current <= right) {
|
|
57
|
+
// Handle elements smaller than left pivot
|
|
58
|
+
if (compareFunction(array[current], array[low]) < 0) {
|
|
59
|
+
[array[current], array[left]] = [array[left], array[current]];
|
|
60
|
+
left++;
|
|
61
|
+
}
|
|
62
|
+
// Handle elements larger than right pivot
|
|
63
|
+
else if (compareFunction(array[current], array[high]) > 0) {
|
|
64
|
+
// Find suitable position from right
|
|
65
|
+
while (current < right &&
|
|
66
|
+
compareFunction(array[right], array[high]) > 0) {
|
|
67
|
+
right--;
|
|
68
|
+
}
|
|
69
|
+
[array[current], array[right]] = [array[right], array[current]];
|
|
70
|
+
right--;
|
|
71
|
+
// Check if swapped element is smaller than left pivot
|
|
72
|
+
if (compareFunction(array[current], array[low]) < 0) {
|
|
73
|
+
[array[current], array[left]] = [array[left], array[current]];
|
|
74
|
+
left++;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
current++;
|
|
78
|
+
}
|
|
79
|
+
// Move pivots to their final positions
|
|
80
|
+
left--;
|
|
81
|
+
right++;
|
|
82
|
+
[array[low], array[left]] = [array[left], array[low]];
|
|
83
|
+
[array[high], array[right]] = [array[right], array[high]];
|
|
84
|
+
return { leftPivotIndex: left, rightPivotIndex: right };
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Sort small arrays using selection sort
|
|
88
|
+
* @param array - Array to be sorted
|
|
89
|
+
* @param start - Starting index
|
|
90
|
+
* @param end - Ending index
|
|
91
|
+
* @param compareFunction - Comparison function
|
|
92
|
+
*/
|
|
93
|
+
const insertionSort = (array, start, end, compareFunction) => {
|
|
94
|
+
for (let index = start + 1; index <= end; index++) {
|
|
95
|
+
const current = array[index];
|
|
96
|
+
let index_ = index - 1;
|
|
97
|
+
while (index_ >= start && compareFunction(array[index_], current) > 0) {
|
|
98
|
+
array[index_ + 1] = array[index_];
|
|
99
|
+
index_--;
|
|
100
|
+
}
|
|
101
|
+
array[index_ + 1] = current;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Internal implementation of dual-pivot quicksort
|
|
106
|
+
* @param array - Array to be sorted
|
|
107
|
+
* @param start - Starting index
|
|
108
|
+
* @param end - Ending index
|
|
109
|
+
* @param compareFunction - Comparison function
|
|
110
|
+
* @param insertionSortThreshold - Threshold for switching to insertion sort
|
|
111
|
+
*/
|
|
112
|
+
const sortRange = (array, start, end, compareFunction, insertionSortThreshold) => {
|
|
113
|
+
// Use insertion sort for small arrays
|
|
114
|
+
if (end - start + 1 <= insertionSortThreshold) {
|
|
115
|
+
insertionSort(array, start, end, compareFunction);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// Get partition indices
|
|
119
|
+
const { leftPivotIndex, rightPivotIndex } = partition(array, start, end, compareFunction);
|
|
120
|
+
// Sort left partition
|
|
121
|
+
sortRange(array, start, leftPivotIndex - 1, compareFunction, insertionSortThreshold);
|
|
122
|
+
// Sort middle partition
|
|
123
|
+
if (rightPivotIndex - leftPivotIndex > 1) {
|
|
124
|
+
sortRange(array, leftPivotIndex + 1, rightPivotIndex - 1, compareFunction, insertionSortThreshold);
|
|
125
|
+
}
|
|
126
|
+
// Sort right partition
|
|
127
|
+
sortRange(array, rightPivotIndex + 1, end, compareFunction, insertionSortThreshold);
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Sort array using dual-pivot quicksort algorithm
|
|
131
|
+
* More efficient than traditional quicksort for arrays with many duplicate values
|
|
132
|
+
* @param array - Array to be sorted
|
|
133
|
+
* @param compareFunction - Optional comparison function
|
|
134
|
+
* @param startIndex - Optional starting index (default: 0)
|
|
135
|
+
* @param endIndex - Optional ending index (default: array.length - 1)
|
|
136
|
+
* @param insertionSortThreshold - Optional threshold for insertion sort (default: 10)
|
|
137
|
+
* @returns Sorted array
|
|
138
|
+
* @example
|
|
139
|
+
* dualPivotQuickSort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3]); // [1, 1, 2, 3, 3, 4, 5, 5, 6, 9]
|
|
140
|
+
* dualPivotQuickSort(['banana', 'apple', 'orange']); // ['apple', 'banana', 'orange']
|
|
141
|
+
*/
|
|
142
|
+
export const dualPivotQuickSort = (array, compareFunction = (compareFunctionDefault), startIndex = 0, endIndex = array.length - 1, insertionSortThreshold = 10) => {
|
|
143
|
+
// Validate and adjust indices
|
|
144
|
+
const validStartIndex = Math.max(0, Math.min(startIndex, array.length - 1));
|
|
145
|
+
const validEndIndex = Math.max(validStartIndex, Math.min(endIndex, array.length - 1));
|
|
146
|
+
// Sort array if valid range exists
|
|
147
|
+
if (validEndIndex >= validStartIndex) {
|
|
148
|
+
sortRange(array, validStartIndex, validEndIndex, compareFunction, insertionSortThreshold);
|
|
149
|
+
}
|
|
150
|
+
return array;
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=dualPivotQuickSort.js.map
|
|
@@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.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { First } from "../types/logic/first";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param array
|
|
5
|
-
* @returns
|
|
3
|
+
* Returns the first element of an array
|
|
4
|
+
* @param array The input array
|
|
5
|
+
* @returns The first element of the array, or undefined if the array is empty
|
|
6
6
|
* @example first([1, 2, 3]); // 1
|
|
7
7
|
*/
|
|
8
8
|
export declare const first: <T extends unknown[]>(array: T) => First<T> extends never ? T[number] | undefined : First<T>;
|
package/module/Array/first.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param array
|
|
4
|
-
* @returns
|
|
2
|
+
* Returns the first element of an array
|
|
3
|
+
* @param array The input array
|
|
4
|
+
* @returns The first element of the array, or undefined if the array is empty
|
|
5
5
|
* @example first([1, 2, 3]); // 1
|
|
6
6
|
*/
|
|
7
7
|
export const first = (array) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param length
|
|
4
|
-
* @param min
|
|
5
|
-
* @param max
|
|
6
|
-
* @param random
|
|
7
|
-
* @returns
|
|
2
|
+
* Generates an array of numbers with the specified length
|
|
3
|
+
* @param length The length of the array
|
|
4
|
+
* @param min The minimum value (default: 0)
|
|
5
|
+
* @param max The maximum value (default: length - 1)
|
|
6
|
+
* @param random Whether to generate random values (default: false)
|
|
7
|
+
* @returns Array of numbers
|
|
8
8
|
* @example generateNumberArray(5); // [0, 1, 2, 3, 4]
|
|
9
9
|
* @example generateNumberArray(5, 10, 14); // [10, 11, 12, 13, 14]
|
|
10
10
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param length
|
|
4
|
-
* @param min
|
|
5
|
-
* @param max
|
|
6
|
-
* @param random
|
|
7
|
-
* @returns
|
|
2
|
+
* Generates an array of numbers with the specified length
|
|
3
|
+
* @param length The length of the array
|
|
4
|
+
* @param min The minimum value (default: 0)
|
|
5
|
+
* @param max The maximum value (default: length - 1)
|
|
6
|
+
* @param random Whether to generate random values (default: false)
|
|
7
|
+
* @returns Array of numbers
|
|
8
8
|
* @example generateNumberArray(5); // [0, 1, 2, 3, 4]
|
|
9
9
|
* @example generateNumberArray(5, 10, 14); // [10, 11, 12, 13, 14]
|
|
10
10
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {T[]} array
|
|
4
|
-
* @param {T[][]} arrays
|
|
5
|
-
* @returns {O}
|
|
2
|
+
* Extract common elements from multiple arrays
|
|
3
|
+
* @param {T[]} array The first array
|
|
4
|
+
* @param {T[][]} arrays Additional arrays to compare
|
|
5
|
+
* @returns {O} Array containing common elements
|
|
6
6
|
* @example getArraysCommon([1, 2, 3], [2, 3, 4], [2, 5, 3]); // [2, 3]
|
|
7
7
|
*/
|
|
8
8
|
export declare const getArraysCommon: <O, T extends unknown[] = unknown[]>(array: T, ...arrays: T[]) => O;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {T[]} array
|
|
4
|
-
* @param {T[][]} arrays
|
|
5
|
-
* @returns {O}
|
|
2
|
+
* Extract common elements from multiple arrays
|
|
3
|
+
* @param {T[]} array The first array
|
|
4
|
+
* @param {T[][]} arrays Additional arrays to compare
|
|
5
|
+
* @returns {O} Array containing common elements
|
|
6
6
|
* @example getArraysCommon([1, 2, 3], [2, 3, 4], [2, 5, 3]); // [2, 3]
|
|
7
7
|
*/
|
|
8
8
|
export const getArraysCommon = (array, ...arrays) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {T[]} array
|
|
4
|
-
* @param {T[]} arrays
|
|
5
|
-
* @returns unknown[]
|
|
2
|
+
* Extract elements that are not common between arrays
|
|
3
|
+
* @param {T[]} array The first array
|
|
4
|
+
* @param {T[]} arrays Additional arrays to compare
|
|
5
|
+
* @returns {unknown[]} Array containing elements that appear only once across all arrays
|
|
6
6
|
* @example getArraysDiff([1, 2, 3], [2, 3, 4]); // [1, 4]
|
|
7
7
|
*/
|
|
8
8
|
export declare const getArraysDiff: <O, T extends unknown[] = unknown[]>(array: T, ...arrays: T[]) => O;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {T[]} array
|
|
4
|
-
* @param {T[]} arrays
|
|
5
|
-
* @returns unknown[]
|
|
2
|
+
* Extract elements that are not common between arrays
|
|
3
|
+
* @param {T[]} array The first array
|
|
4
|
+
* @param {T[]} arrays Additional arrays to compare
|
|
5
|
+
* @returns {unknown[]} Array containing elements that appear only once across all arrays
|
|
6
6
|
* @example getArraysDiff([1, 2, 3], [2, 3, 4]); // [1, 4]
|
|
7
7
|
*/
|
|
8
8
|
export const getArraysDiff = (array, ...arrays) => {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param array
|
|
4
|
-
* @param iteratee
|
|
5
|
-
* @returns
|
|
2
|
+
* Groups elements of an array based on a given iteratee function
|
|
3
|
+
* @param array Array to group
|
|
4
|
+
* @param iteratee Function to determine the group key for each element
|
|
5
|
+
* @returns Object with grouped elements
|
|
6
|
+
* @example
|
|
7
|
+
* groupBy([6.1, 4.2, 6.3], Math.floor); // { '4': [4.2], '6': [6.1, 6.3] }
|
|
8
|
+
* groupBy(["one", "two", "three"], (str) => str.length); // { '3': ['one', 'two'], '5': ['three'] }
|
|
9
|
+
* groupBy(["apple", "banana", "carrot"], (str) => str[0]); // { 'a': ['apple'], 'b': ['banana'], 'c': ['carrot'] }
|
|
6
10
|
*/
|
|
7
11
|
export declare const groupBy: <T, K extends string | number>(array: T[], iteratee: (value: T, index: number, array: T[]) => K) => Record<K, T[]>;
|
package/module/Array/groupBy.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param array
|
|
4
|
-
* @param iteratee
|
|
5
|
-
* @returns
|
|
2
|
+
* Groups elements of an array based on a given iteratee function
|
|
3
|
+
* @param array Array to group
|
|
4
|
+
* @param iteratee Function to determine the group key for each element
|
|
5
|
+
* @returns Object with grouped elements
|
|
6
|
+
* @example
|
|
7
|
+
* groupBy([6.1, 4.2, 6.3], Math.floor); // { '4': [4.2], '6': [6.1, 6.3] }
|
|
8
|
+
* groupBy(["one", "two", "three"], (str) => str.length); // { '3': ['one', 'two'], '5': ['three'] }
|
|
9
|
+
* groupBy(["apple", "banana", "carrot"], (str) => str[0]); // { 'a': ['apple'], 'b': ['banana'], 'c': ['carrot'] }
|
|
6
10
|
*/
|
|
7
11
|
export const groupBy = (array, iteratee) => {
|
|
8
12
|
return array.reduce((accumulator, value, index, array) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupBy.js","sourceRoot":"","sources":["../../src/Array/groupBy.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"groupBy.js","sourceRoot":"","sources":["../../src/Array/groupBy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,KAAU,EACV,QAAoD,EACpC,EAAE;IAClB,OAAO,KAAK,CAAC,MAAM,CACjB,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QACnC,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACxB,CAAC;QACD,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,WAAW,CAAC;IACrB,CAAC,EACD,EAAoB,CACrB,CAAC;AACJ,CAAC,CAAC"}
|