101
101 copied to clipboard
A modern JS utility library
``` js var isHandler = function (key) { return /^handler/.test(key) } bindAll(obj, isHandler) ```
replace
``` js // values ['a','a','a'].map(replace('a', 'b')) // ['b','b','b'] // functions ['a','a','a'].map(replace(equals('a'), returnVal('b'))) // ['b','b','b'] ```
methods that use `clone` can cause it to throw errors. these error message are not developer friendly (stack traces pointing to `clone` code) throw more better errors in these scenarios...
Is it possible to bend `set` to set properties through a function? I mean like: ``` js var markdown = require("marked"); [{string: "..."}, {string: "..."}].map(compose ( set("html", markdown) , pluck("string")...
Maybe we can use this out to start (for the versions we've missed): https://github.com/lalitkapoor/github-changes
``` js var opts = {} defaults(opts, { 'foo.bar': 'hai' }) console.log(opts.foo.bar) // "hai" ```
unique
to get unique values in an array 1) make it work with `arr.reduce` 2) maybe accept an an optional `equals` arg?