From ac03e5dc7606d646e10cc7366e89e7a43dc78f02 Mon Sep 17 00:00:00 2001 From: Gajus Kuizinas Date: Mon, 5 Jun 2017 14:55:42 +0100 Subject: [PATCH] fix: merge tagged values with direct values --- src/utilities/mapTaggedTemplateLiteralInvocation.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/utilities/mapTaggedTemplateLiteralInvocation.js b/src/utilities/mapTaggedTemplateLiteralInvocation.js index b7a70f7b..081229a1 100644 --- a/src/utilities/mapTaggedTemplateLiteralInvocation.js +++ b/src/utilities/mapTaggedTemplateLiteralInvocation.js @@ -6,14 +6,11 @@ import type { } from '../types'; export default (targetMethod: *) => { - return (maybeQuery: string | TaggledTemplateLiteralInvocationType, values?: DatabaseQueryValuesType) => { + return (maybeQuery: string | TaggledTemplateLiteralInvocationType, values: DatabaseQueryValuesType = []) => { if (typeof maybeQuery === 'string') { return targetMethod(maybeQuery, values); } else { - return targetMethod(maybeQuery.sql, [ - ...maybeQuery.values, - values - ]); + return targetMethod(maybeQuery.sql, maybeQuery.values.concat(values)); } }; };