Skip to content

Commit

Permalink
Fix error on Node <9.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ranisalt committed May 11, 2019
1 parent 297f17f commit 654f9e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions argon2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
const { ok } = require('assert').strict
const assert = require('assert')
const { randomBytes, timingSafeEqual } = require('crypto')
const { promisify } = require('util')
const { hash: _hash, limits, types, names, version } = require('node-gyp-build')(__dirname)
Expand All @@ -20,7 +20,7 @@ const generateSalt = promisify(randomBytes)

const assertLimits = options => ([key, { max, min }]) => {
const value = options[key]
ok(min <= value && value <= max, `Invalid ${key}, must be between ${min} and ${max}.`)
assert(min <= value && value <= max, `Invalid ${key}, must be between ${min} and ${max}.`)
}

const hash = async (plain, { raw, salt, ...options } = {}) => {
Expand Down

0 comments on commit 654f9e5

Please sign in to comment.