adamhalasz / uniqid

Unique ID Generator
https://adamhalasz.com
617 stars 49 forks source link

TypeError: Cannot read property 'mac' of undefined #36

Open s4uron opened 3 years ago

s4uron commented 3 years ago

If I add an Object.prototype function to my project, I get this error.

Example function to reproduce:

Object.prototype.pickProperties = function(keys) { console.log("called!"); var clone = {}; for(var i = 0; i < keys.length; i++) { var key = keys[i]; if(this.hasOwnProperty(key)) { clone[key] = this[key]; } } return clone; };

TypeError: Cannot read property 'mac' of undefined at Object. (...\node_modules\uniqid\index.js:22:36)

I'm using the latest Version: uniqid@5.2.0