json-s:与JSON相同,但增加了对Date,undefined,NaN,Infinity和RegExp的支持

时间:2021-05-28 17:41:25
【文件属性】:
文件名称:json-s:与JSON相同,但增加了对Date,undefined,NaN,Infinity和RegExp的支持
文件大小:16KB
文件格式:ZIP
更新时间:2021-05-28 17:41:25
JavaScript JSON-S JSON-小号erializer 与JSON相同,但增加了对以下内容的支持: Date undefined NaN Inifinity RegExp JSON是JavaScript值的很好的序列化器,但是缺少一些JavaScript类型,例如Date : const assert = require ( "assert" ) ; let obj = { time : new Date ( "2042-01-01" ) , } ; // JSON converts dates to strings assert ( obj . time . constructor === Date ) ; obj = JSON . parse ( JSON . stringify ( obj ) ) ; assert ( obj . time . constructor
【文件预览】:
json-s-master
----index.js(144B)
----readme.template.md(1KB)
----package.json(571B)
----parse.js(41B)
----readme.md(5KB)
----test()
--------index.js(2KB)
----stringify.js(45B)
----src()
--------parse.js(637B)
--------stringify.js(996B)
--------types.js(1KB)
----.npmignore(24B)
----index.d.ts(1KB)
----examples()
--------inspect.js(433B)
--------json-s-date.js(332B)
--------simple.js(361B)
--------test-json-s.js(1KB)
--------json-s-flat.js(320B)
--------json-s.js(1KB)
--------json-date.js(285B)
----.gitignore(68B)
----yarn.lock(14KB)

网友评论