Skip to content

Commit

Permalink
feat: sort container declarations by id
Browse files Browse the repository at this point in the history
  • Loading branch information
velut committed Jan 10, 2024
1 parent 6d18907 commit ed1a7df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/container-declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
type SourceFile,
} from "ts-morph";
import { ambientModulesDeclarations } from "./ambient-modules-declarations";
import { compareId } from "./compare-id";
import { exportEqualsDeclarations } from "./export-equals-declarations";
import { exportedDeclarations } from "./exported-declarations";
import { extractClass } from "./extract-class";
Expand Down Expand Up @@ -65,7 +66,7 @@ export const containerDeclarations = async ({
),
);
}
return containerDeclarations;
return containerDeclarations.sort(compareId);
};

const extractDeclaration = (
Expand Down Expand Up @@ -100,15 +101,16 @@ const extractDeclaration = (
return extractInterface(containerName, exportName, declaration);
}
if (isEnum(declaration)) {
return undefined;
return { id: "TODO:" };
}
if (isTypeAlias(declaration)) {
return extractTypeAlias(containerName, exportName, declaration);
}
if (isNamespace(declaration) && maxDepth > 0) {
return undefined;
return { id: "TODO:" };
}
if (isModule(declaration) && maxDepth > 0) {
return undefined;
return { id: "TODO:" };
}
return { id: "TODO:" };
};

0 comments on commit ed1a7df

Please sign in to comment.