mateusmaso / underscore.deepclone

Underscore helper for deep cloning objects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deepClone() method not defined on underscore

mindjuice opened this issue · comments

This isn't working in my project. It hits the exports = factory(_); line during initialization (see below), but then when I call _.deepClone() from my app, the internal underscore that you are using isn't augmented with a deepClone() method, so it crashes.

if (typeof exports !== 'undefined') {
  var _ = require('underscore');
  if (typeof module !== 'undefined' && module.exports)
    module.exports = factory(_);
  exports = factory(_);
} else {
  root._.mixin(factory(root._));
}

I'm using Browserify for my builds, although not sure if that matters.

This is the same issue that is fixed by PR #2.

I'll be taking a look on that and pushing a new version soon, thanks for pointing out