UNPKG

env-var

Version:

Verification, sanitization, and type coercion for environment variables in Node.js

14 lines (9 loc) 228 B
'use strict' const asJson = require('./json') module.exports = function asJsonArray (value) { var ret = asJson(value) if (!Array.isArray(ret)) { throw new Error('should be a parseable JSON Array') } return ret }