normalize-options.js 468 B

1234567891011121314151617181920
  1. "use strict";
  2. var isValue = require("./is-value");
  3. var forEach = Array.prototype.forEach, create = Object.create;
  4. var process = function (src, obj) {
  5. var key;
  6. for (key in src) obj[key] = src[key];
  7. };
  8. // eslint-disable-next-line no-unused-vars
  9. module.exports = function (opts1/*, …options*/) {
  10. var result = create(null);
  11. forEach.call(arguments, function (options) {
  12. if (!isValue(options)) return;
  13. process(Object(options), result);
  14. });
  15. return result;
  16. };