evaluate-string
v1.0.0
Published
Convert strings to respective types
Downloads
3
Maintainers
Readme
evaluate-strings
Convert strings to respective types.
// Strings
evaluteString('john')
evaluteString('snow')
evaluteString('module')
evaluteString('window')
// Numbers
evaluteString('5')
// Booleans
evaluteString('false')
evaluteString('true')
// Objects
evaluteString(`{id: 1, name: 'john snow'}`)
evaluteString(`{"id": 1, "name": "john snow"}`)
// Arrays
evaluteString('[1, 2]')
evaluteString(`['a', 'b']`)
evaluteString(`[true, false]`)
evaluteString(`[{id: 1, name: 'john snow'}, {id: 1, name: 'john snow'}]`)