Skip to content

Get an object from a string which is separated by some endpoints

Notifications You must be signed in to change notification settings

zetogk/str-to-obj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

str-to-obj

Get an object from a string which is separated by some endpoints

Example

Code

const stringToObject = require('str-to-obj');

const queryString = 'type:car,color:blue,year:2005';
const myObject = stringToObject(queryString, ',', ':');

console.log(myObject);

Result

{
    type: 'car',
    color: 'blue',
    year: '2005'
}

About

Get an object from a string which is separated by some endpoints

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published