UNPKG

@magic/test

Version:

simple yet powerful unit testing library

17 lines (14 loc) 396 B
/** * Get function names from environment variable FN * @param {NodeJS.ProcessEnv} [env=process.env] - Environment variables object * @returns {string | string[]} - Either a string or array of function names */ export const getFNS = (env = process.env) => { let { FN = '' } = env if (FN) { if (FN.includes(' ')) { return FN.split(/ ,;/).filter(a => a) } } return FN }