Skip to content

Commit

Permalink
feat(classes): store source and destination on mapping; use .name ins…
Browse files Browse the repository at this point in the history
…tead of toString()
  • Loading branch information
Chau Tran authored and Chau Tran committed Sep 21, 2021
1 parent 73d19a3 commit 6b0530c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/classes/src/lib/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const classes: MapPluginInitializer<Constructible> = (errorHandler) => {
// If a mapping already exists, handle error and return;
if (mappingStorage.has(source, destination)) {
errorHandler.handle(
`Mapping for source ${source.toString()} and destination ${destination.toString()} already exists`
`Mapping for source ${source.name} and destination ${destination.name} already exists`
);
return;
}
Expand Down Expand Up @@ -71,6 +71,7 @@ export const classes: MapPluginInitializer<Constructible> = (errorHandler) => {
sourceNestedConstructible as unknown[],
destinationNestedConstructible as unknown[],
(mapping) => {
mapping[MappingClassId.keys] = [source, destination];
mappingStorage.set(source, destination, mapping);
},
options,
Expand Down Expand Up @@ -106,7 +107,7 @@ export const classes: MapPluginInitializer<Constructible> = (errorHandler) => {
// handle error and fail fast if not found
if (!mapping) {
errorHandler.handle(
`Mapping not found for source ${source.toString()} and destination ${destination.toString()}`
`Mapping not found for source ${source.name} and destination ${destination.name}`
);
return;
}
Expand Down

0 comments on commit 6b0530c

Please sign in to comment.