Skip to content

Commit

Permalink
fix: replace deprecated String.prototype.substr()
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 <[email protected]>
  • Loading branch information
CommanderRoot committed Apr 5, 2022
1 parent aaad61e commit f7f3bc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ const normalizeObject = pkg => {
const clean = {}
let hasBins = false
Object.keys(orig).forEach(binKey => {
const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).substr(1)
const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1)

if (typeof orig[binKey] !== 'string' || !base)
return

const binTarget = join('/', orig[binKey])
.replace(/\\/g, '/').substr(1)
.replace(/\\/g, '/').slice(1)

if (!binTarget)
return
Expand Down

0 comments on commit f7f3bc4

Please sign in to comment.