Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@openfn/compiler

Package Overview
Dependencies
Maintainers
5
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfn/compiler - npm Package Compare versions

Comparing version
1.2.2
to
1.2.3
+25
-8
dist/index.js

@@ -321,2 +321,16 @@ // src/compile.ts

// src/transforms/lazy-state.ts
var LazyStateError = class extends Error {
fix;
details;
pos;
constructor(message, { details, fix, pos } = {}) {
const posStr = (pos && `(${pos.start.line}:${pos.start.column})`) ?? "";
super(`Lazy State Error: ${message} ${posStr}`);
this.fix = fix;
this.details = details;
const { start, end } = pos;
this.pos = { start, end };
delete this.stack;
}
};
var ensureParentArrow = (path2) => {

@@ -329,3 +343,6 @@ let root = path2;

if (n3.Statement.check(root.node) || n3.Declaration.check(root.node)) {
throw new Error(`invalid state operator: must be inside an expression`);
throw new LazyStateError("Must be inside an operation", {
pos: path2.node.loc,
details: "The Lazy State operation must be used inside a top-level operation, like fn(). It cannot be used inside a regular JavaScript statement because no valid state reference is available."
});
}

@@ -344,5 +361,5 @@ }

} else {
throw new Error(
`invalid state operator: must be be passed as an argument to an operator`
);
throw new LazyStateError("must be passed as an argument to an operator", {
pos: path2.node.loc
});
}

@@ -358,7 +375,7 @@ };

}
throw new Error(
`invalid state operator: parameter "${name}" should be called "state"`
);
throw new LazyStateError(`parameter "${name}" should be called "state"`, {
pos: path2.node.loc
});
}
throw new Error("invalid state operator: parent has wrong arity");
throw new LazyStateError("parent has wrong arity", { pos: path2.node.loc });
}

@@ -365,0 +382,0 @@ return false;

{
"name": "@openfn/compiler",
"version": "1.2.2",
"version": "1.2.3",
"description": "Compiler and language tooling for openfn jobs.",

@@ -37,4 +37,4 @@ "author": "Open Function Group <admin@openfn.org>",

"@openfn/describe-package": "0.1.5",
"@openfn/lexicon": "^1.3.0",
"@openfn/logger": "1.1.1"
"@openfn/logger": "1.1.1",
"@openfn/lexicon": "^1.4.1"
},

@@ -41,0 +41,0 @@ "files": [