Skip to content

Commit

Permalink
fix: replace deprecated String.prototype.substr() (#38)
Browse files Browse the repository at this point in the history
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
  • Loading branch information
CommanderRoot committed Apr 5, 2022
1 parent 24a1f3c commit 56dbfa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/link-mans.js
Expand Up @@ -11,7 +11,7 @@ const linkMans = ({ path, pkg, top, force }) => {
// break any links to c:\\blah or /foo/blah or ../blah
// and filter out duplicates
const set = [...new Set(pkg.man.map(man =>
man ? join('/', man).replace(/\\|:/g, '/').substr(1) : null)
man ? join('/', man).replace(/\\|:/g, '/').slice(1) : null)
.filter(man => typeof man === 'string'))]

return Promise.all(set.map(man => {
Expand Down

0 comments on commit 56dbfa0

Please sign in to comment.