Comparing version 1.0.3 to 1.0.4
26
mql.js
@@ -40,4 +40,4 @@ import { | ||
const is_plain_object = obj => !!obj && typeof obj == 'object' && obj.constructor == Object; | ||
const is_column = f => f && f[SymbolColumn]; | ||
const is_tag = f => f && f[SymbolTag]; | ||
const is_column = f => !!(f && f[SymbolColumn]); | ||
const is_tag = f => !!(f && f[SymbolTag]); | ||
const is_injection = query => query == SymbolInjection; | ||
@@ -79,5 +79,5 @@ | ||
me.column.originals.concat(pluck('left_key', me.rels)), | ||
map(c => me.as + '.' + c), | ||
map(c => is_string(c) ? me.as + '.' + c : c), | ||
uniq)) : | ||
tag(SymbolColumn); | ||
tag(SymbolInjection); | ||
@@ -227,13 +227,9 @@ const columnize = v => | ||
return Object.assign(tag(function() { | ||
return { | ||
text: originals | ||
.map(v => | ||
is_string(v) ? | ||
columnize(v) : | ||
Object | ||
.entries(v) | ||
.map(v => v.map(dq).join(' AS ')) | ||
.join(', ')) | ||
.join(', ') | ||
}; | ||
let sqls = deep_flat(originals | ||
.map(v => | ||
is_string(v) ? [{ text: columnize(v) }, { text: ', ' }] : | ||
is_tag(v) ? [v(), { text: ', ' }] : | ||
[{ text: Object.entries(v).map(v => v.map(dq).join(' AS ')).join(', ')}, { text: ', ' }])); | ||
sqls.pop(); | ||
return merge_query(sqls); | ||
}), { [SymbolColumn]: true, originals: originals }); | ||
@@ -240,0 +236,0 @@ } |
{ | ||
"name": "mql2", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "query builder", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38068
674