Skip to content

Commit

Permalink
Revert "Fix printing start of alias (#81)" (#82)
Browse files Browse the repository at this point in the history
This reverts commit d845e1d.
  • Loading branch information
lucasavila00 authored Sep 28, 2023
1 parent d845e1d commit 2d1dffe
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,27 +158,13 @@ export const printSelectStatementInternal = (
selectStatement: SelectStatement<any, any, any, any>,
parenthesis: boolean
): PrintInternalRet => {
const selectionStar = selectStatement.__props.selection
.map((it) => {
if (isStarSymbol(it)) {
return [];
}
if (isStarOfAliasSymbol(it)) {
return it.aliases.map((alias) => `${alias}.*`);
}
return [];
})
// flatten
.reduce((p, c) => [...p, ...c], [])
.join(", ");

const selectionKvs = selectStatement.__props.selection
const selection = selectStatement.__props.selection
.map((it) => {
if (isStarSymbol(it)) {
return ["*"];
}
if (isStarOfAliasSymbol(it)) {
return [];
return it.aliases.map((alias) => `${alias}.*`);
}
// check if the proxy was returned in an identity function
if (isTheProxyObject(it.content)) {
Expand All @@ -196,13 +182,6 @@ export const printSelectStatementInternal = (
.reduce((p, c) => [...p, ...c], [])
.join(", ");

const selection =
selectionStar.length > 0
? selectionKvs.length > 0
? `${selectionStar}, (${selectionKvs})`
: selectionStar
: selectionKvs;

const replaceInner = selectStatement.__props.replace
.map(([k, v]) => {
const vContent: string | number = isSafeString(v) ? v.content : v;
Expand Down

0 comments on commit 2d1dffe

Please sign in to comment.