mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user