@balena/abstract-sql-compiler
Advanced tools
Comparing version 7.0.4 to 7.0.5-remove-type-casts-c8e61c426077b2fe8f697f12c0f8ecb30a082d8b
@@ -7,2 +7,6 @@ # Change Log | ||
## 7.0.5 - 2020-11-30 | ||
* Remove some type casts [Pagan Gazzard] | ||
## 7.0.4 - 2020-11-25 | ||
@@ -9,0 +13,0 @@ |
@@ -65,5 +65,6 @@ "use strict"; | ||
}; | ||
const isFromNode = (n) => n[0] === 'From'; | ||
const getScope = (rulePart, scope) => { | ||
scope = { ...scope }; | ||
const fromNodes = rulePart.filter((node) => node[0] === 'From'); | ||
const fromNodes = rulePart.filter(isFromNode); | ||
fromNodes.forEach((node) => { | ||
@@ -140,3 +141,3 @@ const nested = node[1]; | ||
} | ||
const froms = query.filter((n) => n[0] === 'From'); | ||
const froms = query.filter(isFromNode); | ||
if (froms.length !== 1) { | ||
@@ -143,0 +144,0 @@ return; |
{ | ||
"name": "@balena/abstract-sql-compiler", | ||
"version": "7.0.4", | ||
"version": "7.0.5-remove-type-casts-c8e61c426077b2fe8f697f12c0f8ecb30a082d8b", | ||
"description": "A translator for abstract sql into sql.", | ||
@@ -5,0 +5,0 @@ "main": "out/AbstractSQLCompiler.js", |
@@ -375,2 +375,4 @@ export const enum Engines { | ||
const isFromNode = (n: AbstractSqlType): n is FromNode => n[0] === 'From'; | ||
type Scope = _.Dictionary<string>; | ||
@@ -380,3 +382,3 @@ | ||
scope = { ...scope }; | ||
const fromNodes = rulePart.filter((node) => node[0] === 'From') as FromNode[]; | ||
const fromNodes = rulePart.filter(isFromNode); | ||
fromNodes.forEach((node) => { | ||
@@ -466,3 +468,3 @@ const nested = node[1]; | ||
const froms = query.filter((n) => n[0] === 'From') as FromNode[]; | ||
const froms = query.filter(isFromNode); | ||
if (froms.length !== 1) { | ||
@@ -490,3 +492,3 @@ return; | ||
.flatMap((v) => v[1]) | ||
.value() as string[]; | ||
.value(); | ||
return { table: tableName, fields }; | ||
@@ -493,0 +495,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
521460
7294
2