Skip to content

Commit

Permalink
Update example to use new object-assign polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
pbeshai committed Feb 16, 2017
1 parent e9b51a3 commit a510768
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion example/d3-interpolate-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
(factory((global.d3 = global.d3 || {}),global.d3));
}(this, (function (exports,d3Interpolate) { 'use strict';

var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];

for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}

return target;
};

/**
* List of params for each command type in a path `d` attribute
*/
Expand Down Expand Up @@ -174,7 +188,7 @@ function extend(commandsToExtend, referenceCommands, numPointsToExtend) {
extended.push(commandsToExtend[i]);

for (var j = 1; j < counts[i] && numExtended < numPointsToExtend; j++) {
var commandToAdd = Object.assign({}, commandsToExtend[i]);
var commandToAdd = _extends({}, commandsToExtend[i]);
// don't allow multiple Ms
if (commandToAdd.type === 'M') {
commandToAdd.type = 'L';
Expand Down

0 comments on commit a510768

Please sign in to comment.