mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16: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:
@@ -1491,7 +1491,7 @@ describe('Sorted Set methods', () => {
|
||||
await db.sortedSetAdd('sortedSetLexSearch', [0, 0, 0], ['baris:usakli:1', 'baris usakli:2', 'baris soner:3']);
|
||||
const query = 'baris:';
|
||||
const min = query;
|
||||
const max = query.substr(0, query.length - 1) + String.fromCharCode(query.charCodeAt(query.length - 1) + 1);
|
||||
const max = query.slice(0, -1) + String.fromCharCode(query.charCodeAt(query.length - 1) + 1);
|
||||
const result = await db.getSortedSetRangeByLex('sortedSetLexSearch', min, max, 0, -1);
|
||||
assert.deepStrictEqual(result, ['baris:usakli:1']);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user