refactor: replace deprecated String.prototype.substr() (#10432)

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
CommanderRoot
2022-03-31 19:49:56 +02:00
committed by GitHub
parent 0d744d30f2
commit 200f0b2e4f
19 changed files with 26 additions and 26 deletions

View File

@@ -577,11 +577,11 @@ DELETE FROM "legacy_zset" z
if (min !== '-') {
if (min.match(/^\(/)) {
q.values.push(min.substr(1));
q.values.push(min.slice(1));
q.suffix += 'GT';
q.where += ` AND z."value" > $${q.values.length}::TEXT COLLATE "C"`;
} else if (min.match(/^\[/)) {
q.values.push(min.substr(1));
q.values.push(min.slice(1));
q.suffix += 'GE';
q.where += ` AND z."value" >= $${q.values.length}::TEXT COLLATE "C"`;
} else {
@@ -593,11 +593,11 @@ DELETE FROM "legacy_zset" z
if (max !== '+') {
if (max.match(/^\(/)) {
q.values.push(max.substr(1));
q.values.push(max.slice(1));
q.suffix += 'LT';
q.where += ` AND z."value" < $${q.values.length}::TEXT COLLATE "C"`;
} else if (max.match(/^\[/)) {
q.values.push(max.substr(1));
q.values.push(max.slice(1));
q.suffix += 'LE';
q.where += ` AND z."value" <= $${q.values.length}::TEXT COLLATE "C"`;
} else {