escaping
v0.1.2
Published
Escape, unescape and split strings by char
Downloads
6
Readme
Escaping
Functions for escaping characters and removing escaping.
Install
npm install escaping
Usage
escape()
import { escape } from 'escaping';
let result = escape('1.2.3', '.', '\\'); // '1\\.2\\.3'
unescape()
import { unescape } from 'escaping';
let result = unescape('1\\.2\\.3', '.', '\\'); // '1.2.3'
split()
import { split } from 'escaping';
let result = split('1.2.3', '.', '\\'); // ['1', '2', '3']
Testing
To run tests, use:
npm test