src/index.js
function filterObject(gobj, filter) {
	let found = true;
	let obj = gobj;

	// find the value we're interested in
	for (let i = 0, len = filter.length; obj && typeof obj === 'object' && i < len; i++) {
		if (!obj.hasOwnProperty(filter[i])) {
			found = false;
			obj = undefined;
			break;
		}
		obj = obj[filter[i]];
	}

	return { found, obj };
}
function filterObject(gobj, filter) {
	let found = true;
	let obj = gobj;

	// find the value we're interested in
	for (let i = 0, len = filter.length; obj && typeof obj === 'object' && i < len; i++) {
		if (!obj.hasOwnProperty(filter[i])) {
			found = false;
			obj = undefined;
			break;
		}
		obj = obj[filter[i]];
	}

	return { found, obj };
}
function filterObject ( gobj , filter ) { let found = true ; let obj = gobj ; // find the value we're interested in for ( let i = 0 , len = filter . length ; obj && typeof obj === 'object' && i < len ; i ++ ) { if ( ! obj . hasOwnProperty ( filter [ i ] ) ) { found = false ; obj = undefined ; break ; } obj = obj [ filter [ i ] ] ; } return { found , obj } ; }
Filters the specified gawk object.

@param {Object} gobj - A gawked object.
@param {Array.<String>} filter - The filter to apply to the gawked object.
@returns {Object}
Filters the specified gawk object .