UNPKG

only-changed-jest-watch-plugin

Version:

Jest watch plugin for running either only the modified test (for TDD), or tests of dependant modules

12 lines (11 loc) 269 B
'use strict' module.exports = function objFilter (original, filter) { const obj = {} filter = filter || ((k, v) => true) Object.keys(original || {}).forEach((key) => { if (filter(key, original[key])) { obj[key] = original[key] } }) return obj }