Skip to content

Commit

Permalink
Improve Node.js compatibility
Browse files Browse the repository at this point in the history
Replace Array.prototype.findIndex() with Array.prototype.indexOf()
  • Loading branch information
m4l3vich authored Oct 3, 2021
1 parent 891188e commit 3627adc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benedict.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const letters = 'абвгдеёжзийклмнопрстуфхцчшщэюя'.s
if (process.argv.length === 4) {
// Specify your name and surname to generate
// your personal name variant (https://i.imgur.com/jTlLd5c.png)
const first = letters.findIndex(e => e === process.argv[2].charAt(0).toLowerCase())
const second = letters.findIndex(e => e === process.argv[3].charAt(0).toLowerCase())
const first = letters.indexOf(process.argv[2].charAt(0).toLowerCase())
const second = letters.indexOf(process.argv[3].charAt(0).toLowerCase())

if (first === -1 || second === -1) return console.log('¯\_(ツ)_/¯')

Expand Down

0 comments on commit 3627adc

Please sign in to comment.