mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 07:07:33 +00:00
Replace deprecated substr with substring (#355)
* Make the QueryRunner more readable * Remove use of deprecated substr and replace with substring, and some formatting
This commit is contained in:
parent
65dd876252
commit
5b01e1be17
9 changed files with 66 additions and 61 deletions
|
|
@ -53,8 +53,8 @@ class Teamspeak3 extends Core {
|
|||
const unit = {};
|
||||
for (const field of split) {
|
||||
const equals = field.indexOf('=');
|
||||
const key = equals === -1 ? field : field.substr(0,equals);
|
||||
const value = equals === -1 ? '' : field.substr(equals+1)
|
||||
const key = equals === -1 ? field : field.substring(0, equals);
|
||||
const value = equals === -1 ? '' : field.substring(equals + 1)
|
||||
.replace(/\\s/g,' ').replace(/\\\//g,'/');
|
||||
unit[key] = value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue