UNPKG

@obliczeniowo/elementary

Version:
41 lines (38 loc) 1.23 kB
class ParseString { /** * Parse string and remove pair of double quotes from begin and and of string * @param value string to parse * @returns parsed string * * @example * * "\"some \"dummy text\"\"" => "some \"dummy text\"" */ static parseStringRemoveDblQuotes = (value) => value.replace(/^"(.*)"$/, '$1'); /** * Parse string and remove pair of single quotes from begin and and of string * @param value string to parse * @returns parsed string * * @example * * "'some 'dummy text''" => "some 'dummy text'" */ static parseStringRemoveSingleQuotes = (value) => value.replace(/^'(.*)'$/, '$1'); /** * Parse string and remove pair of double quotes or single quotes from begin and and of string * @param value string to parse * @returns parsed string * * @example * * "\"some \"dummy text\"\"" => "some \"dummy text\"" * "'some 'dummy text''" => "some 'dummy text'" */ static parseStringRemoveQuotes = (value) => value.replace(/^['"](.*)['"]$/, '$1'); } /** * Generated bundle index. Do not edit. */ export { ParseString }; //# sourceMappingURL=obliczeniowo-elementary-parsing.mjs.map