
Product
Introducing Manifest Alerts
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.
@isl-lang/evaluator
Advanced tools
Expression evaluator for ISL - runtime evaluation and verification of contracts
Expression evaluator for ISL - runtime evaluation and verification of contracts.
npm install @isl-lang/evaluator
# or
pnpm add @isl-lang/evaluator
import { Evaluator, createContext } from '@isl-lang/evaluator';
// Create evaluation context with bindings
const context = createContext({
user: {
name: 'Alice',
age: 25,
email: 'alice@example.com'
},
config: {
maxUsers: 100
}
});
// Evaluate expressions
const evaluator = new Evaluator(context);
// Simple expressions
evaluator.evaluate('user.age >= 18'); // true
evaluator.evaluate('user.name.length > 0'); // true
evaluator.evaluate('config.maxUsers'); // 100
// Contract validation
const precondition = 'user.age >= 18 && user.email.contains("@")';
const isValid = evaluator.evaluate(precondition);
EvaluatorMain evaluator class.
const evaluator = new Evaluator(context);
// Evaluate expression to value
const result = evaluator.evaluate(expression);
// Evaluate with type checking
const typed = evaluator.evaluateTyped(expression);
createContext(bindings: object): EvalContextCreate an evaluation context with variable bindings.
validateContract(contract: Contract, context: EvalContext): ValidationResultValidate a contract (precondition/postcondition) against a context.
import { validateContract } from '@isl-lang/evaluator';
const result = validateContract(
{ expression: 'input.amount > 0', type: 'precondition' },
context
);
if (!result.valid) {
console.error('Contract violation:', result.message);
}
Supported operators and functions:
==, !=, <, >, <=, >=&&, ||, !+, -, *, /, %.length, .contains(), .startsWith(), .endsWith().includes(), .every(), .some(), .filter(), .map().isNull(), .isValid(), .typeof()Full documentation: https://isl-lang.dev/docs/evaluator
MIT
FAQs
Expression evaluator for ISL - runtime evaluation and verification of contracts
The npm package @isl-lang/evaluator receives a total of 7 weekly downloads. As such, @isl-lang/evaluator popularity was classified as not popular.
We found that @isl-lang/evaluator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.