summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/flatten.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/flatten.js')
-rw-r--r--tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/flatten.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/flatten.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/flatten.js
new file mode 100644
index 0000000000..e8b40444a9
--- /dev/null
+++ b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/flatten.js
@@ -0,0 +1,17 @@
+'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;
+};