/*
Filter object on keys matching the prefix `x-`.
@param object {object} - object to fetch properties from
@returns {object} - object with only properties prefixed with `x-`
162488
function getCustomProperties(object) {
  var result = {};
  for (var key in object) {
    if (/^x-/.test(key)) {
      result[key] = object[key];
    }
  }
  return result;
}
702286
function processExpressionObject( val, key ) {
	var operator;
	if ( sys.isObject( val ) ) {
		var opKeys = Object.keys( val );
		var op = opKeys[ 0 ];

		if ( sys.indexOf( nestedOps, op ) > -1 ) {
			operator = processNestedOperator( key, val );
		} else if ( sys.indexOf( prefixOps, key ) > -1 ) {
			operator = processPrefixOperator( key, val );
		} else if ( op === "$regex" ) {
			// special handling for regex options
			operator = processNestedOperator( key, val );
		} else if ( op === "$elemMatch" ) {
			// elemMatch is just a weird duck
			operator = {
				path      : key,
				operation : op,
				operands  : []
			};
			sys.each( val[ op ], function ( entry ) {
				operator.operands = parseQueryExpression( entry );
			} );
		}
		else {
			throw new Error( "Unrecognized operator" );
		}
	} else {
		operator = processNestedOperator( key, { $eq : val } );
	}
	return operator;
}
767090
function applyFilterOnObject(obj, filterFn) {
    if (filterFn == null) {
        return Object.assign({}, obj);
    }

    const filteredObj = {};
    coreObjectEntries(obj).forEach(([key, val]) => {
        if (filterFn(val, key)) {
            filteredObj[key] = val;
        }
    });

    return filteredObj;
}
1286977
function exclude(object, props) {
  const newObject = {};

  Object.keys(object).forEach(function(prop) {
    if (props.indexOf(prop) === -1) {
      newObject[prop] = object[prop];
    }
  });

  return newObject;
}
388117
function wash(obj) {
	if (!obj) {
		return {};
	}

	var keys = Object.keys(obj);
	for (var i = 0; i < keys.length; i++) {
		var key = keys[i];

		if (obj[key] === undefined) {
			delete obj[key];
		}
	}

	return obj;
}
227595
function freeze(object) {

	/* retrieve the property names defined on object */
	const propNames = Object.getOwnPropertyNames(object);

	/* recursively freeze properties before freezing self */
	for(const name of propNames) {
		const value = object[name];
		object[name] = value && typeof value === "object" ? freeze(value) : value;
	}

	/* return frozen object */
	return Object.freeze(object);
}
1256124
function(prefix, f) {
    var retF = function(env) {
        Object.keys(env)
            .forEach(function(x) {
                var val = env[x];
                if ((typeof val === 'string') &&
                    (val.indexOf(prefix) === 0)) {
                    var propName = val.substring(prefix.length,
                                                 val.length);
                    env[x] = f(propName);
                } else if (Array.isArray(val)) {
                    retF(val);
                } else if (val && (typeof val === 'object')) {
                    retF(val);
                }
            });
    };
    return retF;
}
706093
function baseKeysIn(object) {
  if (!isObject_1(object)) {
    return _nativeKeysIn(object);
  }
  var isProto = _isPrototype(object),
      result = [];

  for (var key in object) {
    if (!(key == 'constructor' && (isProto || !hasOwnProperty$11.call(object, key)))) {
      result.push(key);
    }
  }
  return result;
}
989041
function querystringify(obj, prefix) {
  prefix = prefix || '';

  var pairs = []
    , value
    , key;

  //
  // Optionally prefix with a '?' if needed
  //
  if ('string' !== typeof prefix) prefix = '?';

  for (key in obj) {
    if (has.call(obj, key)) {
      value = obj[key];

      //
      // Edge cases where we actually want to encode the value to an empty
      // string instead of the stringified value.
      //
      if (!value && (value === null || value === undef || isNaN(value))) {
        value = '';
      }

      key = encodeURIComponent(key);
      value = encodeURIComponent(value);

      //
      // If we failed to encode the strings, we should bail out as we don't
      // want to add invalid strings to the query.
      //
      if (key === null || value === null) continue;
      pairs.push(key +'='+ value);
    }
  }

  return pairs.length ? prefix + pairs.join('&') : '';
}
1132247
function (filter) {
    var obj = {}
    var val = this.__input

    this.each(function (property, key) {
      obj[key] = property.flatten ? property.flatten(filter) : property
    }, wrapFilter(filter))

    if (val !== void 0) {
      if (val instanceof Base) {
        val = {
          reference: val.path
        }
      }
      obj.val = val
    }

    // refactoring non standard keys
    var flattened = flatten(obj)
    for (var key in flattened) {
      if (key.indexOf('.val') > 0) {
        var newKey = key.split('.val')[0]
        flattened[newKey] = flattened[key]
        delete flattened[key]
      }
    }
    return flattened
  }
772260
def custom_object_prefix_strict(instance):
    
    if (instance['type'] not in enums.TYPES and
            instance['type'] not in enums.RESERVED_OBJECTS and
            not CUSTOM_TYPE_PREFIX_RE.match(instance['type'])):
        yield JSONError("Custom object type '%s' should start with 'x-' "
                        "followed by a source unique identifier (like a "
                        "domain name with dots replaced by hyphens), a hyphen "
                        "and then the name." % instance['type'],
                        instance['id'], 'custom-prefix')
904792
function pick(obj, keys) {
  const res = {}
  const len = keys.length
  let idx = -1
  let key

  while (++idx < len) {
    key = keys[idx]
    if (key in obj) {
      res[key] = obj[key]
    }
  }
  return res
}
1249987
function _deepKeys(obj, prefix = null) {
  return Object.keys(obj).reduce(function(acc, key){
    var value = obj[key];

    if (_isObject(value)) {
      acc.push.apply(acc, _deepKeys(value, prefix ? prefix + '.' + key : key));
    } else {
      acc.push(prefix ? prefix + '.' + key : key);
    }

    return acc;
  }, []);
}
1364883
function (obj) {
        var keys = []
        for (var key in obj) {
            if (obj.hasOwnProperty(key)) {
                keys.push(key)
            }
        }
        return keys
    }
886565
function indexKeys(object) {
        var length = object ? object.length : undefined;
        if (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) {
          return baseTimes(length, String);
        }
        return null;
      }
3137
function get(obj, keyName) {
    if(obj == null || keyName == null) {
        return null;
    }
    if(keyName.indexOf('.') == -1) {
        return obj[keyName];
    }
    var keyNames = keyName.split('.');
    if(keyNames == null) {
        return null;
    }
    for(var i=0; i<keyNames.length; i++) {
        var res = obj[keyNames[i]];
        if(res == null) {
            return null;
        }
        obj = res;
    }
    return res;
}
992254
function _get(obj, keypath) {
    var parts = _keyPathNormalize(keypath).split('.')
    var dest = obj
    parts.forEach(function(key) {
        if (isNon(dest)) return !(dest = undf())
        dest = dest[key]
    })
    return dest
}