Skip to content

Commit

Permalink
feat(postgres): remove useless object for aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinot authored and mrrinot committed Feb 19, 2020
1 parent 242d048 commit 2c2ce36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dialects/abstract/query-generator.js
Expand Up @@ -1615,7 +1615,7 @@ class QueryGenerator {

const minifiedAlias = `_${options.aliasesMapping.size}`;

options.aliasesMapping.set(minifiedAlias, { alias });
options.aliasesMapping.set(minifiedAlias, alias);
options.aliasesByTable[`${tableName}${alias}`] = minifiedAlias;

return minifiedAlias;
Expand Down
2 changes: 1 addition & 1 deletion lib/dialects/postgres/query.js
Expand Up @@ -88,7 +88,7 @@ class Query extends AbstractQuery {
.map(row => _.toPairs(row)
.reduce((acc, [key, value]) => {
const mapping = this.options.aliasesMapping.get(key);
acc[mapping ? mapping.alias : key] = value;
acc[mapping || key] = value;
return acc;
}, {})
);
Expand Down

0 comments on commit 2c2ce36

Please sign in to comment.