How to use the object-assign.apply function in object-assign

To help you get started, we’ve selected a few object-assign examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github YR / component / index.js View on Github external
var comp = function (_Component) {
      babelHelpers.inherits(comp, _Component);

      function comp() {
        babelHelpers.classCallCheck(this, comp);
        return babelHelpers.possibleConstructorReturn(this, _Component.apply(this, arguments));
      }

      return comp;
    }(Component);

    // Handle mixins
    if (mixins && mixins.length) {
      // Merge/clone
      mixins = assign.apply(undefined, [{}].concat(mixins));
      // Store method names to autobind on instantiation
      specification.__bindableMethods = Object.keys(mixins).filter(function (key) {
        return !~RESERVED_METHODS.indexOf(key) && 'function' == typeof mixins[key];
      });
      specification = assign(specification, mixins);
    }
    comp.displayName = specification.displayName || '';
    delete specification.displayName;

    // Rename select keys to prevent overwriting
    proxyKeys(specification, PROXY_KEYS);
    // Copy to comp prototype
    assign(comp.prototype, specification);

    return function createElement(props) {
      processProps(props, specification);
github firejune / electron-react-devtools / src / frontend / Panel.js View on Github external
// properly doing so probably requires refactoring how we load the panel
      // and communicate with the bridge.
      return (
        <div style="{loadingStyle(theme)}">
          <h2>Connecting to React…</h2>
        </div>
      );
    }
    if (!this.state.isReact) {
      return (
        <div style="{loadingStyle(theme)}">
          <h2>Looking for React…</h2>
        </div>
      );
    }
    var extraTabs = assign.apply(null, [{}].concat(this.plugins.map(p =&gt; p.tabs())));
    var extraPanes = [].concat(...this.plugins.map(p =&gt; p.panes()));
    if (this._store.capabilities.rnStyle) {
      extraPanes.push(panelRNStyle(this._bridge, this._store.capabilities.rnStyleMeasure, theme));
    }
    return (
       {
            if (!val || node.get('nodeType') !== 'Composite' || val[consts.type] !== 'function') {
              return undefined;
            }
            return [this.props.showAttrSource &amp;&amp; {
              key: 'showSource',
              title: 'Show function source',
github pandawing / node-chrome-web-store-item-property / src / get.js View on Github external
function mergeConfig(url, userConfig) {
  userConfig = userConfig || {};
  var opts = objectAssign({}, defaultConfig, userConfig);
  opts.url = url;
  var headerCandidate = [{}, defaultConfig.headers];
  if (userConfig.hasOwnProperty('headers')) {
    headerCandidate.push(userConfig.headers);
  }
  opts.headers = objectAssign.apply(null, headerCandidate);
  var qsCandidate = [{}, defaultConfig.qs];
  if (userConfig.hasOwnProperty('qs')) {
    qsCandidate.push(userConfig.qs);
  }
  opts.qs = objectAssign.apply(null, qsCandidate);
  return opts;
}
github pandawing / node-chrome-web-store-item-property / src / merge-config.js View on Github external
var headerCandidate = [{}];
  if (Object.prototype.hasOwnProperty.call(defaultConfig, 'headers')) {
    headerCandidate.push(defaultConfig.headers);
  }
  if (Object.prototype.hasOwnProperty.call(userConfig, 'headers')) {
    headerCandidate.push(userConfig.headers);
  }
  opts.headers = objectAssign.apply(null, headerCandidate);
  var qsCandidate = [{}];
  if (Object.prototype.hasOwnProperty.call(defaultConfig, 'qs')) {
    qsCandidate.push(defaultConfig.qs);
  }
  if (Object.prototype.hasOwnProperty.call(userConfig, 'qs')) {
    qsCandidate.push(userConfig.qs);
  }
  opts.qs = objectAssign.apply(null, qsCandidate);
  return opts;
};
github aemoe / webpack-react-framework / node_modules / react / lib / React.js View on Github external
__spread = function () {
    process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
    warned = true;
    return _assign.apply(null, arguments);
  };
}
github skatejs / skatejs / src / api / properties / index.js View on Github external
return function (...args) {
    args.unshift({}, def);
    return assign.apply(null, args);
  };
}
github angus-c / just / node_modules / react / lib / React.js View on Github external
__spread = function () {
    lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.');
    warnedForSpread = true;
    return _assign.apply(null, arguments);
  };
github DeligenceTechnologies / PanoplyCMS / node_modules / react / lib / React.js View on Github external
__spread = function () {
    process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
    warned = true;
    return _assign.apply(null, arguments);
  };
}
github glenjamin / devboard / lib / components / DevCard.js View on Github external
function styles() {
  var args = [].slice.apply(arguments);
  args.unshift({});
  return objectAssign.apply(this, args);
}

object-assign

ES2015 `Object.assign()` ponyfill

MIT
Latest version published 8 years ago

Package Health Score

77 / 100
Full package analysis