},
exists: (a) => {
if (a == null) {
- const type = /^[aeiou]/i.test(typeof a) ? `an ${typeof a}` : `a ${typeof a}`
- throw new Error(`argument exists and is ${type}`)
+ throw new Error(`argument is ${typeof a}`)
}
return a != null
},
}
return a !== b
},
+ nullish: (a) => {
+ if (a != null) {
+ const type = /^[aeiou]/i.test(typeof a) ? `an ${typeof a}` : `a ${typeof a}`
+ throw new Error(`argument exists and is ${type}`)
+ }
+ return a == null
+ },
rejects: async (fn, msg) => {
if (fn.constructor.name === 'AsyncFunction') {
fn = fn()