UNPKG

authenzify

Version:

server to manage authentication authorization of users and more

16 lines (13 loc) 373 B
export const sleep = async (milliseconds) => { return new Promise((resolve) => setTimeout(resolve, milliseconds)) } export const verifyExistence = (ref, fnList) => { for (const fn of fnList) { if (!ref[fn]) { throw new Error(`${fn} Doesn't exists`) } if (typeof ref[fn] !== 'function') { throw new Error(`${fn} is not a function`) } } }