UNPKG

@qtikit/mathml-to-latex

Version:

A JavaScript tool to convert mathml string to LaTeX string

22 lines (21 loc) 804 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ParenthesisWrapper = void 0; var wrapper_1 = require("./wrapper"); var ParenthesisWrapper = /** @class */ (function () { function ParenthesisWrapper() { this._open = '\\left('; this._close = '\\right)'; this._closed = /^(\\left\(\\right.).*(\\left.\\right\))$/i; } ParenthesisWrapper.prototype.wrap = function (str) { return new wrapper_1.Wrapper(this._open, this._close).wrap(str); }; ParenthesisWrapper.prototype.wrapIfMoreThanOneChar = function (str) { if (str.length <= 1 || this._closed.test(str) == true) return str; return this.wrap(str); }; return ParenthesisWrapper; }()); exports.ParenthesisWrapper = ParenthesisWrapper;