Socket
Socket
Sign inDemoInstall

formula-store

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

57

lib/index.js

@@ -52,3 +52,3 @@ "use strict";

catch (ex) {
fieldGraph.removeNode(node);
removeField(node.id);
throw new errors_1.FormulaFieldCircularDependencyError(node.id);

@@ -79,30 +79,31 @@ }

};
const removeField = (fieldId) => {
if (!addedFields.has(fieldId)) {
throw new errors_1.FormulaFieldNotFoundError(fieldId);
}
const field = addedFields.get(fieldId);
const fieldToRecalculate = getFieldsToRecalculateOnNodeChanges(field);
addedFields.delete(fieldId);
fieldGraph.removeNode(field);
dependencyTree = fieldGraph.kahnTopologicalSort();
const changes = [];
for (const dep of dependencyTree) {
const node = fieldToRecalculate.get(dep.id);
if (!node) {
continue;
}
node.value = node.calculate(...node.incomingNeighbors.map(n => {
const field = addedFields.get(n);
return field.value;
}));
changes.push({
id: node.id,
value: node.value
});
}
onChange(changes);
return changes.map(c => c.id);
};
return {
removeField: fieldId => {
if (!addedFields.has(fieldId)) {
throw new errors_1.FormulaFieldNotFoundError(fieldId);
}
const field = addedFields.get(fieldId);
const fieldToRecalculate = getFieldsToRecalculateOnNodeChanges(field);
addedFields.delete(fieldId);
fieldGraph.removeNode(field);
dependencyTree = fieldGraph.kahnTopologicalSort();
const changes = [];
for (const dep of dependencyTree) {
const node = fieldToRecalculate.get(dep.id);
if (!node) {
continue;
}
node.value = node.calculate(...node.incomingNeighbors.map(n => {
const field = addedFields.get(n);
return field.value;
}));
changes.push({
id: node.id,
value: node.value
});
}
onChange(changes);
return changes.map(c => c.id);
},
removeField,
editField: ({ id, value, dependencies, calculate }) => {

@@ -109,0 +110,0 @@ checkFields(id, dependencies);

{
"name": "formula-store",
"description": " A package to handle formula calculations and dependency management",
"version": "1.1.0",
"version": "1.1.1",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "types": "lib/index.d.ts",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc