Skip to content

madhavanand-github/jsObjectString-to-jsObject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JS Object String to JS Object

A npm package that converts/parses the JavaScript Object in String Type to JavaScript Object.

Input : JavaScript Object as String Type
Output : JavaScript Object

The Problem

image

Example

Object Strings Failed to parse

const objString = "{ url : 'http://google.com' }"
const objString = "{ 'url' : 'http://google.com' }"
image

How to use

// Import
const customParser = require('object-string-to-object')  

// Test String
const objString = '{ url : "http://google.com" }';  

// Output
const result = customParser(objString);  

For a correct input, output is 100% correct.
For an incorrect input, you may get an undesired output/error.
For an Error, null is returned.

About

A npm package that converts the JavaScript Object in String Type to JavaScript Object

Resources

License

Stars

Watchers

Forks

Packages

No packages published