diff --git a/index.js b/index.js index 06c3c4b..5ff05d4 100644 --- a/index.js +++ b/index.js @@ -114,7 +114,7 @@ function parse(code) { code = removeComments(code); let match; - const elements = []; + let elements = []; // look for interfaces let interfaceFreeCode = code; @@ -170,6 +170,8 @@ function parse(code) { } code = constFreeCode; + elements = elements.sort((a, b) => b[1].extends ? 1 : 0 - a[1].extends ? 1 : 0).reverse(); // for extending bullshit + return elements; } @@ -178,7 +180,6 @@ async function recursiveReaddir(rpath, p, fileNames) { fileNames = (fileNames || []).slice(); const files = await fs.readdir(rpath); for (const f of files) { - console.log(f); const stat = await fs.lstat(path.join(rpath, f)); if (stat.isDirectory() || stat.isSymbolicLink()) { fileNames.push(...await recursiveReaddir(path.join(rpath, f), p + f + '/', fileNames));