UNPKG

localscope

Version:

Add all of an object's values to the local scope, with the variable names of their keys

13 lines (11 loc) 227 B
module.exports = function(name) { return ( "eval(" + "Object.keys(" + name + ").map(" + "function(key) {" + "return 'var ' + key + ' = " + name + "[\"' + key + '\"];'" + "}" + ").join('')" + ")" ); };