@wareset-utilites/escape
v0.1.9
Published
WIP: wareset-utilites: escape
Downloads
1
Readme
@wareset-utilites/escape
Escape regexp
Usage
import esc from '@wareset-utilites/escape';
Method: escape(string: String, ignoreSymbols: String, isNewFn: Boolean)
const str = `{[()]}`;
console.log(esc(str)); // \\{\\[\\(\\)\\]\\}
console.log(esc(str, '{()}')); // {\\[()\\]}
// if exists 'ignoreSymbols' and 'isNewFn' is true:
const newEsc = esc(null, '{()}', true);
console.log(newEsc(str)); // {\\[()\\]}
License
MIT