Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auxin

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auxin - npm Package Compare versions

Comparing version 1.13.8 to 1.14.8

1

dist/arrayUtils.d.ts

@@ -18,2 +18,3 @@ export declare namespace arrayUtils {

function quickSort<T>(arr: T[]): T[];
function quickSortDescending<T>(arr: T[]): T[];
function arrPush<T>(arr: T[], target: T): T[];

@@ -20,0 +21,0 @@ function arrUnshift<T>(arr: T[], target: T): T[];

@@ -63,2 +63,20 @@ "use strict";

arrayUtils.quickSort = quickSort;
function quickSortDescending(arr) {
if (arr.length <= 1) {
return arr;
}
const pivot = arr[0];
const left = [];
const right = [];
for (let i = 1; i < arr.length; i++) {
if (arr[i] >= pivot) { // Modified condition for descending order
left.push(arr[i]);
}
else {
right.push(arr[i]);
}
}
return [...quickSortDescending(left), pivot, ...quickSortDescending(right)]; // Recursively sort left and right arrays
}
arrayUtils.quickSortDescending = quickSortDescending;
function arrPush(arr, target) {

@@ -127,4 +145,4 @@ arr.push(target);

arrayUtils.arrToLowerCase = arrToLowerCase;
// Add more array utility functions here as needed...
// Add more array utility functions here as needed...
})(arrayUtils || (exports.arrayUtils = arrayUtils = {}));
//# sourceMappingURL=arrayUtils.js.map

2

package.json
{
"name": "auxin",
"version": "1.13.8",
"version": "1.14.8",
"description": "Auxin is a powerful Node.js utility toolkit that simplifies common tasks, boosting your development productivity.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -61,2 +61,23 @@ export module arrayUtils {

}
export function quickSortDescending<T>(arr: T[]): T[] {
if (arr.length <= 1) {
return arr;
}
const pivot = arr[0];
const left = [];
const right = [];
for (let i = 1; i < arr.length; i++) {
if (arr[i] >= pivot) { // Modified condition for descending order
left.push(arr[i]);
} else {
right.push(arr[i]);
}
}
return [...quickSortDescending(left), pivot, ...quickSortDescending(right)]; // Recursively sort left and right arrays
}

@@ -129,5 +150,3 @@ export function arrPush<T>(arr: T[], target: T): T[] {

// Add more array utility functions here as needed...
// Add more array utility functions here as needed...
}

@@ -11,2 +11,12 @@ const { arrayUtils } = require('../dist/arrayUtils'); // Import the array utility functions to be tested

const decarrr = [3, 1, 4, 1, 5, 9, 2, 6, 5];
const dec = arrayUtils.quickSortDescending(decarrr);
console.log("dec",dec); // Output: [1, 1, 2, 3, 4, 5, 5, 6, 9]
// const desarrr = [5, 2, 8, 1, 9];
// const sortedDescending = quickSortDescending(desarrr);
// console.log(sortedDescending); // Output: [9, 8, 5, 2, 1]
const pushedArray = arrayUtils.arrPush(arr, 3);

@@ -13,0 +23,0 @@ console.log(pushedArray);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc