blob: cda747504d91242cf51636d61330a197e42de8e0 [file] [log] [blame]
"use strict";
var isPlainObject = require("./is-plain-object")
, forEach = require("./for-each")
, process;
process = function self(value, key) {
if (isPlainObject(value)) forEach(value, self, this);
else this[key] = value;
};
module.exports = function (obj) {
var flattened = {};
forEach(obj, process, flattened);
return flattened;
};