Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "nestia", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Automatic SDK and Document generator for the NestJS", | ||
@@ -5,0 +5,0 @@ "main": "src/index.ts", |
@@ -16,5 +16,6 @@ import * as fs from "fs"; | ||
{ | ||
const root: Directory = new Directory("functional"); | ||
const root: Directory = new Directory(null, "functional"); | ||
for (const route of routeList) | ||
emplace(root, route); | ||
remix(root); | ||
@@ -41,3 +42,3 @@ const defaultImportDict: ImportDictionary = new ImportDictionary(); | ||
if (it.equals(directory.directories.end()) === true) | ||
it = directory.directories.emplace(key, new Directory(key)).first; | ||
it = directory.directories.emplace(key, new Directory(directory, key)).first; | ||
@@ -50,2 +51,14 @@ // FOR THE NEXT STEP | ||
function remix(directory: Directory): void | ||
{ | ||
if (directory.parent !== null && directory.directories.empty() && directory.routes.length === 1) | ||
{ | ||
directory.parent.routes.push(directory.routes[0]); | ||
directory.parent.directories.erase(directory.name); | ||
} | ||
else if (directory.directories.empty() === false) | ||
for (const it of directory.directories) | ||
remix(it.second); | ||
} | ||
/* --------------------------------------------------------- | ||
@@ -96,3 +109,3 @@ FILE ITERATOR | ||
public constructor(readonly name: string) | ||
public constructor(readonly parent: Directory | null, readonly name: string) | ||
{ | ||
@@ -99,0 +112,0 @@ this.directories = new HashMap(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55680
1228