json-as 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assembly/src/json.ts +2 -2
- package/assembly/test.ts +1 -1
- package/package.json +1 -1
- package/transform/package.json +1 -1
package/assembly/src/json.ts
CHANGED
|
@@ -57,7 +57,7 @@ export namespace JSON {
|
|
|
57
57
|
// @ts-ignore: Hidden function
|
|
58
58
|
return data.__JSON_Serialize();
|
|
59
59
|
} else if (data instanceof Date) {
|
|
60
|
-
return data.toISOString();
|
|
60
|
+
return "\"" + data.toISOString() + "\"";
|
|
61
61
|
} else if (isArrayLike<T>()) {
|
|
62
62
|
// @ts-ignore
|
|
63
63
|
if (data.length == 0) {
|
|
@@ -133,7 +133,7 @@ export namespace JSON {
|
|
|
133
133
|
out = data.__JSON_Serialize();
|
|
134
134
|
return;
|
|
135
135
|
} else if (data instanceof Date) {
|
|
136
|
-
out = data.toISOString();
|
|
136
|
+
out = "\"" + data.toISOString() + "\"";
|
|
137
137
|
return;
|
|
138
138
|
} else if (isArrayLike<T>()) {
|
|
139
139
|
// @ts-ignore
|
package/assembly/test.ts
CHANGED
|
@@ -44,7 +44,7 @@ console.log("Implemented: " + JSON.stringify(JSON.parse<Vec3>('{}', true)));
|
|
|
44
44
|
|
|
45
45
|
console.log("Original: " + JSON.stringify(player));
|
|
46
46
|
//console.log("Revised: " + vec.__JSON_Deserialize('{"x":3,"y":1,"z":8}').__JSON_Serialize());
|
|
47
|
-
console.log("Implemented: " + JSON.stringify(JSON.parse<Player>('{"firstName":"Emmet","lastName":"West","lastActive":2023-11-16T04:06:35.108285303Z,"age":23,"pos":{"x":3.4,"y":1.2,"z":8.3},"isVerified":true}')));
|
|
47
|
+
console.log("Implemented: " + JSON.stringify(JSON.parse<Player>('{"firstName":"Emmet","lastName":"West","lastActive":"2023-11-16T04:06:35.108285303Z","age":23,"pos":{"x":3.4,"y":1.2,"z":8.3},"isVerified":true}')));
|
|
48
48
|
/*
|
|
49
49
|
// 9,325,755
|
|
50
50
|
bench("Stringify Object (Vec3)", () => {
|
package/package.json
CHANGED