diff --git a/lib/formatting.js b/lib/formatting.js index 9bd96112..9db5acfd 100644 --- a/lib/formatting.js +++ b/lib/formatting.js @@ -170,7 +170,7 @@ const formatAs = { array({query, array, raw, options}) { options = options && typeof options === 'object' ? options : {}; return query.replace(npm.patterns.multipleValues, name => { - const v = formatAs.stripName(name.substr(1), raw); + const v = formatAs.stripName(name.substring(1), raw); const idx = v.name - 1; if (idx >= maxVariable) { throw new RangeError(`Variable $${v.name} exceeds supported maximum of $${maxVariable}`); @@ -200,7 +200,7 @@ const formatAs = { const mod = name.match(npm.patterns.hasValidModifier); if (mod) { return { - name: name.substr(0, mod.index), + name: name.substring(0, mod.index), fm: fmMap[mod[0]] | (raw ? fmFlags.raw : 0) }; } diff --git a/lib/helpers/column.js b/lib/helpers/column.js index 623009b6..f966875b 100644 --- a/lib/helpers/column.js +++ b/lib/helpers/column.js @@ -266,11 +266,11 @@ function parseColumn(name) { const res = {}; if (name[0] === '?') { res.cnd = true; - name = name.substr(1); + name = name.substring(1); } const mod = name.match(npm.patterns.hasValidModifier); if (mod) { - res.name = name.substr(0, mod.index); + res.name = name.substring(0, mod.index); res.mod = mod[0]; } else { res.name = name; diff --git a/lib/utils/index.js b/lib/utils/index.js index 30a98481..832dde65 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -162,7 +162,7 @@ function addInspection(type, cb) { // This is for detecting when to skip executing ROLLBACK for a failed transaction. function isConnectivityError(err) { const code = err && typeof err.code === 'string' && err.code; - const cls = code && code.substr(0, 2); // Error Class + const cls = code && code.substring(0, 2); // Error Class // istanbul ignore next (we cannot test-cover all error cases): return code === 'ECONNRESET' || (cls === '08' && code !== '08P01') || (cls === '57' && code !== '57014'); // Code 'ECONNRESET' - Connectivity issue handled by the driver. diff --git a/lib/utils/public.js b/lib/utils/public.js index 4ffebd28..c538b147 100644 --- a/lib/utils/public.js +++ b/lib/utils/public.js @@ -39,7 +39,7 @@ const npm = { */ function camelize(text) { text = text.replace(/[-_\s.]+(.)?/g, (_, c) => c ? c.toUpperCase() : ''); - return text.substr(0, 1).toLowerCase() + text.substr(1); + return text.substring(0, 1).toLowerCase() + text.substring(1); } /**