1.0.1 • Published 1 year ago
@jswork/str2kv v1.0.1
str2kv
String to kv obj.
installation
npm install @jswork/str2kv
usage
import str2kv from '@jswork/str2kv';
// default saparator is [:/@]
const kmstr1 = '1id:value; 2id:value2; 3id:value3';
const obj1 = str2kv(km2str);
// { '1id': 'value', '2id': 'value2', '3id': 'value3' }
// custom saparator
const kmstr2 = '1id:value; 2id:value2; 3id:value3';
const obj2 = str2kv(km2str, ':');
// { '1id': 'value', '2id': 'value2', '3id': 'value3' }
license
Code released under the MIT license.
1.0.1
1 year ago