Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 316 Bytes

.verb.md

File metadata and controls

19 lines (14 loc) · 316 Bytes

Usage

var {%= camelcase(name) %} = require('{%= name %}');

API

{%= apidocs("index.js") %}

Rename based on value

var obj = renameKeys({a: 1, b: 2, c: 3}, function(key, val) {
  return val > 1 ? ('++' + key) : ('--' + key);
});
console.log(obj);
//=> {'--a': 1, '++b': 2, '++c': 3};