web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
354 B

  1. "use strict";
  2. var isPlainObject = require("./is-plain-object")
  3. , forEach = require("./for-each")
  4. , process;
  5. process = function self(value, key) {
  6. if (isPlainObject(value)) forEach(value, self, this);
  7. else this[key] = value;
  8. };
  9. module.exports = function (obj) {
  10. var flattened = {};
  11. forEach(obj, process, flattened);
  12. return flattened;
  13. };