Comparing version
{ | ||
"name": "json-as", | ||
"version": "0.5.12", | ||
"version": "0.5.13", | ||
"description": "JSON encoder/decoder for AssemblyScript", | ||
@@ -5,0 +5,0 @@ "types": "assembly/index.ts", |
@@ -23,2 +23,4 @@ import { ClassDecorator, registerDecorator, } from "visitor-as/dist/decorator.js"; | ||
visitFieldDeclaration(node) { | ||
if (toString(node).startsWith("static")) | ||
return; | ||
const lineText = toString(node); | ||
@@ -50,6 +52,11 @@ if (lineText.startsWith("private")) | ||
visitClassDeclaration(node) { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
if (!node.members) { | ||
return; | ||
} | ||
// Prevent from being triggered twice | ||
for (const member of node.members) { | ||
if (member.name.text == "__JSON_Serialize") | ||
return; | ||
} | ||
this.currentClass = { | ||
@@ -71,5 +78,5 @@ name: toString(node.name), | ||
}); | ||
if (parentSchema.length > 0) { | ||
(_a = parentSchema[0]) === null || _a === void 0 ? void 0 : _a.encodeStmts.push(((_b = parentSchema[0]) === null || _b === void 0 ? void 0 : _b.encodeStmts.pop()) + ","); | ||
this.currentClass.encodeStmts.push(...(_c = parentSchema[0]) === null || _c === void 0 ? void 0 : _c.encodeStmts); | ||
if (parentSchema.length > 0 && ((_a = parentSchema[0]) === null || _a === void 0 ? void 0 : _a.encodeStmts)) { | ||
(_b = parentSchema[0]) === null || _b === void 0 ? void 0 : _b.encodeStmts.push(((_c = parentSchema[0]) === null || _c === void 0 ? void 0 : _c.encodeStmts.pop()) + ","); | ||
this.currentClass.encodeStmts.push(...(_d = parentSchema[0]) === null || _d === void 0 ? void 0 : _d.encodeStmts); | ||
} | ||
@@ -76,0 +83,0 @@ else { |
{ | ||
"name": "@json-as/transform", | ||
"version": "0.5.12", | ||
"version": "0.5.13", | ||
"description": "JSON encoder/decoder for AssemblyScript", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
62655
0.54%1390
0.51%