@wareset-utilites/escape
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

@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

Readme

Keywords

Package Sidebar

Install

npm i @wareset-utilites/escape

Weekly Downloads

7

Version

0.1.9

License

MIT

Unpacked Size

4.17 kB

Total Files

6

Last publish

Collaborators

  • nk12