Skip to content

Commit

Permalink
Merge branch 'CommanderRoot-rm-deprecated-substr'
Browse files Browse the repository at this point in the history
* CommanderRoot-rm-deprecated-substr:
  fix: replace deprecated String.prototype.substr()
  • Loading branch information
lukekarrys committed Aug 22, 2022
2 parents 45a35c3 + f7f3bc4 commit 3d87190
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ 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 3d87190

Please sign in to comment.