UNPKG

@drewsonne/maya-calculator-parser

Version:

Typescript package to parse plaintext calculations and create operators

40 lines 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Layer0Test = (function () { function Layer0Test() { } Layer0Test.isLetter = function (raw) { return this.regexTest(raw, /^['a-zA-Z]$/); }; Layer0Test.isCommentLetter = function (raw) { return this.regexTest(raw, /[^\n]/); }; Layer0Test.isNumber = function (cell) { return this.regexTest(cell, /^\d$/); }; Layer0Test.regexTest = function (cell, pattern) { var result = cell.match(pattern); return (result !== null); }; Layer0Test.isPeriod = function (cell) { return cell === '.'; }; Layer0Test.isCarriageReturn = function (cell) { return cell === "\n"; }; Layer0Test.isSpace = function (cell) { return cell === ' '; }; Layer0Test.isWildcard = function (cell) { return cell === '*'; }; Layer0Test.isCommentStart = function (cell) { return cell === '#'; }; Layer0Test.isOperator = function (cell) { return ['-', '+'].includes(cell); }; return Layer0Test; }()); exports.default = Layer0Test; //# sourceMappingURL=layer-0-test.js.map