]> gerrit.simantics Code Review - simantics/district.git/blob - es5-ext/object/filter.js
Hide "enabled" column for non-component type tech type tables
[simantics/district.git] / es5-ext / object / filter.js
1 'use strict';
2
3 var callable = require('./valid-callable')
4   , forEach  = require('./for-each')
5
6   , call = Function.prototype.call;
7
8 module.exports = function (obj, cb/*, thisArg*/) {
9         var o = {}, thisArg = arguments[2];
10         callable(cb);
11         forEach(obj, function (value, key, obj, index) {
12                 if (call.call(cb, thisArg, value, key, obj, index)) o[key] = obj[key];
13         });
14         return o;
15 };