Comparing version
{ | ||
"name": "json-as", | ||
"version": "0.5.22", | ||
"version": "0.5.23", | ||
"description": "JSON encoder/decoder for AssemblyScript", | ||
@@ -5,0 +5,0 @@ "types": "assembly/index.ts", |
@@ -51,5 +51,5 @@ import { getName, toString, isStdlib } from "visitor-as/dist/utils.js"; | ||
visitClassDeclaration(node) { | ||
var _a; | ||
var _c; | ||
const className = node.name.text; | ||
if (!((_a = node.decorators) === null || _a === void 0 ? void 0 : _a.length)) | ||
if (!((_c = node.decorators) === null || _c === void 0 ? void 0 : _c.length)) | ||
return; | ||
@@ -131,4 +131,18 @@ let foundDecorator = false; | ||
const transformer = new AsJSONTransform(); | ||
// Sort the sources so that user scripts are visited last | ||
const sources = parser.sources.filter(source => !isStdlib(source)).sort((_a, _b) => { | ||
const a = _a.internalPath; | ||
const b = _b.internalPath; | ||
if (a[0] === "~" && b[0] !== "~") { | ||
return -1; | ||
} | ||
else if (a[0] !== "~" && b[0] === "~") { | ||
return 1; | ||
} | ||
else { | ||
return 0; | ||
} | ||
}); | ||
// Loop over every source | ||
for (const source of parser.sources) { | ||
for (const source of sources) { | ||
// Ignore all lib and std. Visit everything else. | ||
@@ -135,0 +149,0 @@ if (!isStdlib(source)) { |
{ | ||
"name": "@json-as/transform", | ||
"version": "0.5.22", | ||
"version": "0.5.23", | ||
"description": "JSON encoder/decoder for AssemblyScript", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
65301
0.75%1465
0.96%