Skip to content

Commit 5619c22

Browse files
committed
refactor: replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]>
1 parent 810e6a4 commit 5619c22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/connection_config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class ConnectionConfig {
145145
// "+" is a url encoded char for space so it
146146
// gets translated to space when giving a
147147
// connection string..
148-
this.timezone = `+${this.timezone.substr(1)}`;
148+
this.timezone = `+${this.timezone.slice(1)}`;
149149
}
150150
if (this.ssl) {
151151
if (typeof this.ssl !== 'object') {
@@ -253,7 +253,7 @@ class ConnectionConfig {
253253
const options = {
254254
host: parsedUrl.hostname,
255255
port: parsedUrl.port,
256-
database: parsedUrl.pathname.substr(1),
256+
database: parsedUrl.pathname.slice(1),
257257
user: parsedUrl.username,
258258
password: parsedUrl.password
259259
};

0 commit comments

Comments
 (0)