From e3b4a305d379d8a3df31d2bf1721e78d70c56d6b Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Sat, 19 Mar 2022 02:40:51 +0100 Subject: [PATCH] chore: 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 --- src/glob-slash.js | 2 +- test/integration.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glob-slash.js b/src/glob-slash.js index 08187e4..2b326ee 100644 --- a/src/glob-slash.js +++ b/src/glob-slash.js @@ -5,5 +5,5 @@ const path = require('path'); const normalize = value => path.posix.normalize(path.posix.join('/', value)); -module.exports = value => (value.charAt(0) === '!' ? `!${normalize(value.substr(1))}` : normalize(value)); +module.exports = value => (value.charAt(0) === '!' ? `!${normalize(value.slice(1))}` : normalize(value)); module.exports.normalize = normalize; diff --git a/test/integration.js b/test/integration.js index 18a1511..bc2abad 100644 --- a/test/integration.js +++ b/test/integration.js @@ -1196,7 +1196,7 @@ test('range request', async t => { t.is(response.status, 206); const text = await response.text(); - const spec = content.toString().substr(0, 11); + const spec = content.toString().slice(0, 11); t.is(text, spec); });