apla / node-clickhouse

Yandex ClickHouse driver for nodejs
MIT License
216 stars 50 forks source link

fix escaping backslashes problem #15

Closed arrterian closed 5 years ago

arrterian commented 6 years ago

The pull request fix problem with escaping backslashes

In code we have: v.replace (/\\/g, '\\')

Its mean: please replace each one backslash with one backslash Because JS has following rules for backslashes in strings and regular expressions

\ — always escapes the next character \\ — always mean one backslash

So for replacing one backslash with two backslashes, we need double this one in second parameters of replace function

v.replace (/\\/g, '\\') -> v.replace (/\\/g, '\\\\')

codecov-io commented 6 years ago

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #15   +/-   ##
=======================================
  Coverage   93.19%   93.19%           
=======================================
  Files           5        5           
  Lines         294      294           
=======================================
  Hits          274      274           
  Misses         20       20
Impacted Files Coverage Δ
src/process-db-value.js 78.94% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9c0f14e...966d7ef. Read the comment docs.

arrterian commented 6 years ago

@apla /ping