d3/d3-interpolate

array.js sometimes reports errors

mrandpz opened this issue · 1 comments

d3-interpolate/src/array.js

import value from "./value";

export default function(a, b) {
  var nb = b ? b.length : 0,
      na = a ? Math.min(nb, a.length) : 0,
      x = new Array(na),
      c = new Array(nb),
      i;


   for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);  // value is {__esModule: true, default: ƒ}
  
  for (; i < nb; ++i) c[i] = b[i];

  return function(t) {
    for (i = 0; i < na; ++i) c[i] = x[i](t);
    return c;
  };
}

It looks like you have a problem with whatever bundler you are using. The default import of value.js is a function.

https://github.com/d3/d3-interpolate/blob/master/src/value.js#L11