pvorb / clone

deeply clone arbitrary objects in javascript
https://www.npmjs.com/package/clone
MIT License
780 stars 128 forks source link

better check for global.Buffer #104

Open mrx8 opened 5 years ago

mrx8 commented 5 years ago

clone.js line 106: } else if (useBuffer && Buffer.isBuffer(parent)) {

can you at least check if Buffer.isBuffer is a function ? I ended up with a failing clone.js in an Angular project, becaus some other (possibly errorneus package) put an array named "Buffer" in global.

pvorb commented 5 years ago

Hi, can you provide a PR?