UNPKG

charlike

Version:

Small, fast, simple and streaming project scaffolder for myself, but not only. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options

11 lines (10 loc) 267 B
module.exports = function (original, filter) { const obj = {} filter = filter || function (k, v) { return true } Object.keys(original || {}).forEach(function (key) { if (filter(key, original[key])) { obj[key] = original[key] } }) return obj }