UNPKG

@sudoo/marked

Version:

JavaScript & TypeScript code runner in JavaScript, safe with marked territory, asynchronous

18 lines (17 loc) 537 B
"use strict"; /** * @author WMXPY * @namespace Operation * @description Logical */ Object.defineProperty(exports, "__esModule", { value: true }); exports.getLogicalOperation = void 0; const getLogicalOperation = (symbol) => { switch (symbol) { case "&&": return (left, right) => left && right; case "||": return (left, right) => left || right; case "??": return (left, right) => left !== null && left !== void 0 ? left : right; } return null; }; exports.getLogicalOperation = getLogicalOperation;