Skip to content

Commit

Permalink
chore: clean up my implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Aug 17, 2021
1 parent d208954 commit dfde4a3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/collections/componentSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,8 @@ export class ComponentSet extends LazyCollection<MetadataComponent> {

const typeMap = new Map<string, string[]>();
for (const key of components.keys()) {
// eslint-disable-next-line prefer-const
let [typeId, fullName] = key.split(ComponentSet.KEY_DELIMITER);
const [typeId, fullName] = key.split(ComponentSet.KEY_DELIMITER);
let type = this.registry.getTypeByName(typeId);
fullName = type.fullName ?? fullName;

if (type.folderContentType) {
type = this.registry.getTypeByName(type.folderContentType);
Expand Down
2 changes: 1 addition & 1 deletion src/registry/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"customlabels": {
"id": "customlabels",
"name": "CustomLabels",
"fullName": "CustomLabels",
"ignoreTypeName": true,
"suffix": "labels",
"directoryName": "labels",
"inFolder": false,
Expand Down
5 changes: 3 additions & 2 deletions src/registry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ export interface MetadataType {
*/
strictDirectoryName?: boolean;
/**
* TBD.
* Whether or not to ignore the type names that's parsed from the file path. If true, the type's name
* will be used instead.
*/
fullName?: string;
ignoreTypeName?: boolean;
/**
* If the type is a folder type (container for components), the id of the type it is a container for.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/resolve/sourceComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ export class SourceComponent implements MetadataComponent {
}

get fullName(): string {
if (this.type.fullName) {
return this.type.fullName;
if (this.type.ignoreTypeName) {
return this.type.name;
}
if (this.parent && this.type.ignoreParentName) {
return this.name;
Expand Down

0 comments on commit dfde4a3

Please sign in to comment.