rado 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -91,21 +91,18 @@ var Selection = class {
91
91
  names.add(exprName);
92
92
  if (hasField(input)) {
93
93
  const field = getField(input);
94
- if (field.fieldName === exprName) return expr;
94
+ if (field.fieldName === exprName) return [expr];
95
95
  }
96
- return sql`${expr.forSelection()} as ${sql.identifier(exprName)}`;
96
+ return [sql`${expr.forSelection()} as ${sql.identifier(exprName)}`];
97
97
  }
98
- return expr;
98
+ return [expr];
99
99
  }
100
- return sql.join(
101
- Object.entries(input).map(
102
- ([name2, value]) => this.#selectionToSql(value, names, name2)
103
- ),
104
- sql`, `
100
+ return Object.entries(input).flatMap(
101
+ ([name2, value]) => this.#selectionToSql(value, names, name2)
105
102
  );
106
103
  }
107
104
  get [internalSql]() {
108
- return this.#selectionToSql(this.input, /* @__PURE__ */ new Set());
105
+ return sql.join(this.#selectionToSql(this.input, /* @__PURE__ */ new Set()), sql`, `);
109
106
  }
110
107
  join(right, operator) {
111
108
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rado",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {