Skip to content

Commit

Permalink
fix: avoid string spread so that TypeScript typings do not require `d…
Browse files Browse the repository at this point in the history
…ownlevelIteration` when targetting ES5

fixes #171
  • Loading branch information
niieani committed Feb 4, 2020
1 parent 16743b8 commit f6bd32c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/hashids.ts
Expand Up @@ -31,9 +31,9 @@ export default class Hashids {
)
}

const saltChars = [...salt]
const alphabetChars = [...alphabet]
const sepsChars = [...seps]
const saltChars = Array.from(salt)
const alphabetChars = Array.from(alphabet)
const sepsChars = Array.from(seps)

this.salt = saltChars

Expand Down Expand Up @@ -265,7 +265,7 @@ export default class Hashids {
lastAlphabet,
buffer.slice(0, lastAlphabet.length),
)
result.push(fromAlphabet([...subId], nextAlphabet))
result.push(fromAlphabet(Array.from(subId), nextAlphabet))
lastAlphabet = nextAlphabet
}

Expand Down

0 comments on commit f6bd32c

Please sign in to comment.