felixfbecker / node-sql-template-strings

ES6 tagged template strings for prepared SQL statements 📋
ISC License
610 stars 40 forks source link

Fix bad `.apply` context #100

Closed WebReflection closed 5 years ago

WebReflection commented 5 years ago

Reading the source code, I've noticed that:

(this.values || this.bind).push.apply(this.values, statement.values)
  ^ it this is falsy                   ^ so is this one

This MR makes the code not fail when useBind and append are used in the wild.

codecov[bot] commented 5 years ago

Codecov Report

Merging #100 into master will not change coverage. The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #100   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          35     36    +1     
  Branches        6      6           
=====================================
+ Hits           35     36    +1
Impacted Files Coverage Δ
index.js 100% <100%> (ø) :arrow_up: