MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / evaluateUnaryExpression

Function evaluateUnaryExpression

src/lib/prettierFormatter.js:450–462  ·  view source on GitHub ↗
(node, scope)

Source from the content-addressed store, hash-verified

448}
449
450function evaluateUnaryExpression(node, scope) {
451 const value = evaluateNode(node.argument, scope);
452 switch (node.operator) {
453 case "+":
454 return +value;
455 case "-":
456 return -value;
457 case "!":
458 return !value;
459 default:
460 throw new Error(`Unsupported unary operator: ${node.operator}`);
461 }
462}
463
464function normalizePath(path) {
465 let result = String(path || "").replace(/\\/g, "/");

Callers 1

evaluateNodeFunction · 0.85

Calls 1

evaluateNodeFunction · 0.85

Tested by

no test coverage detected