JSON替代λJSON.zip

时间:2022-08-04 18:10:53
【文件属性】:
文件名称:JSON替代λJSON.zip
文件大小:16KB
文件格式:ZIP
更新时间:2022-08-04 18:10:53
开源项目 λJSON 是 JSON 的嵌入式替代品,它可以让你解析和字符串化纯函数及其内容。示例代码:var LJSON = require("LJSON");// `newPlayer` is a function and couldn't be serialized with JSON.function newPlayer(name){    return {         name      : name,         hp        : 12,         atk       : 5,         def       : 5,         inventory : []} }; // LJSON has no trouble doing it because `newPlayer` is pure. var newPlayerSource = LJSON.stringify(newPlayer);  var John            = LJSON.parse(newPlayerSource)("John");console.log("Serialized λJSON: "   newPlayerSource);console.log("Parsed and applied: "   John); 标签:json
【文件预览】:
LJSON-master
----package.json(1KB)
----LICENSE(1KB)
----LJSON.js(17KB)
----Examples()
--------ex5_readme_examples.js(1KB)
--------ex7_null_bool_undefined.js(418B)
--------ex4_trusting_user_defined_libs.js(3KB)
--------ex0_hello_world.js(372B)
--------ex6_bounded_loops.js(829B)
--------ex2_math_functions_with_std_lib.js(947B)
--------ex1_objs_with_functions.js(916B)
--------ex3_math_functions_without_lib.js(804B)
----parsenhora.js(6KB)
----README.md(7KB)

网友评论