MCPcopy Create free account
hub / github.com/TechSpiritSS/Terminal-Portfolio / calc

Function calc

scripts/functions.js:481–497  ·  view source on GitHub ↗
(flag)

Source from the content-addressed store, hash-verified

479}
480
481async function calc(flag) {
482 try {
483 if (flag === "" || flag === " " || flag === undefined) {
484 falseValue(flag);
485 await createText("Please Enter a Valid Expression");
486 } else {
487 trueValue(flag);
488 function parse(str) {
489 return Function(`'use strict'; return (${str})`)();
490 }
491 await createText(flag + " = " + parse(flag));
492 }
493 } catch (e) {
494 falseValue(flag);
495 await createText(flag + " is an Invalid Expression");
496 }
497}
498
499// all functions exported
500export {

Callers 1

getInputValueFunction · 0.85

Calls 4

falseValueFunction · 0.85
createTextFunction · 0.85
trueValueFunction · 0.85
parseFunction · 0.85

Tested by

no test coverage detected