1.0.7 • Published 4 years ago

@vparth/str-esc v1.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

str-esc

Utility to escape entities in string

Can also split/join strings with respect of escaping

Example

    // import {EscapeService} from 'str-esc';
    const {EscapeService} = require('str-esc');

    let svc = new EscapeService('%');
    svc.encode('100% Y-m-d', ['Y', 'm', 'd']); // '100%% %Y-%m-%d'

    svc = new EscapeService();
    svc.split(', ', 'a, b\\, c, d');    // ['a', 'b, c', 'd']
    svc.join(', ', ['a', 'b, c', 'd']); // 'a, b\\, c, d'