包详细信息

string2js

piranna11ISC0.2.0

Create Javascript objects and primitives from their string representation

reviver, objects, string, json

自述文件

string2js

Create Javascript objects and primitives from their string representation

This module expose a function to convert string values to Javascript objects. It also offer a reviver() function to be used with JSON.parse().

RegExp

The module allow to reviver RegExp objects. To serialize them automatically as JSON, just add the next snippet to the begining of your code:

if(RegExp.prototype.toJSON === undefined)
   RegExp.prototype.toJSON = RegExp.prototype.toString