New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stx

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stx - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

42

dist/index.js

@@ -1380,2 +1380,28 @@ 'use strict';

const numberSortAsc = (branch, path) => (key1, key2) => {
const leaf1 = branch.leaves[getByPath(branch, key1, path)];
const leaf2 = branch.leaves[getByPath(branch, key2, path)];
return (leaf1 && compute(branch, leaf1)) - (leaf2 && compute(branch, leaf2))
};
const numberSortDesc = (branch, path) => (key1, key2) => {
const leaf1 = branch.leaves[getByPath(branch, key1, path)];
const leaf2 = branch.leaves[getByPath(branch, key2, path)];
return (leaf2 && compute(branch, leaf2)) - (leaf1 && compute(branch, leaf1))
};
const stringSortAsc = (branch, path) => (key1, key2) => {
const leaf1 = branch.leaves[getByPath(branch, key1, path)];
const leaf2 = branch.leaves[getByPath(branch, key2, path)];
return String(leaf1 && compute(branch, leaf1))
.localeCompare(String(leaf2 && compute(branch, leaf2)))
};
const stringSortDesc = (branch, path) => (key1, key2) => {
const leaf1 = branch.leaves[getByPath(branch, key1, path)];
const leaf2 = branch.leaves[getByPath(branch, key2, path)];
return String(leaf2 && compute(branch, leaf2))
.localeCompare(String(leaf1 && compute(branch, leaf1)))
};
const cache = (socket, isMaster, id, stamp) => {

@@ -1522,14 +1548,6 @@ if (!socket.cache) socket.cache = { master: {}, branch: {}, strings: {} };

if (sort && sort.path) {
originalKeys = [...originalKeys].sort((key1, key2) => {
const leaf1 = branch.leaves[getByPath(branch, key1, sort.path)];
const leaf2 = branch.leaves[getByPath(branch, key2, sort.path)];
if (sort.type === 'N') {
const result = (leaf1 && compute(branch, leaf1)) - (leaf2 && compute(branch, leaf2));
return sort.desc ? result * -1 : result
} else if (sort.type === 'S') {
const result = String(leaf1 && compute(branch, leaf1))
.localeCompare(String(leaf2 && compute(branch, leaf2)));
return sort.desc ? result * -1 : result
}
});
const sortFunction = sort.type === 'N'
? sort.desc ? numberSortDesc : numberSortAsc
: sort.desc ? stringSortDesc : stringSortAsc;
originalKeys = [...originalKeys].sort(sortFunction(branch, sort.path));
}

@@ -1536,0 +1554,0 @@

{
"name": "stx",
"version": "0.6.0",
"version": "0.6.1",
"description": "a blazing fast state manager with network sync out of the box",

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

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