adamhalasz / uniqid

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

Bug – Reserved word with browserify #18

Closed Buzut closed 6 years ago

Buzut commented 6 years ago

This bug didn't exist in version 4.1.1. Now requiring the module with browserify (16.2.2) returns:

SyntaxError: unknown: interface is a reserved word in strict mode (475:14)
  473 |     var mac = '', interfaces = require('os').networkInterfaces();
  474 |     for(interface_key in interfaces){
> 475 |         const interface = interfaces[interface_key], length = interface.length;
      |               ^
  476 |         for(var i = 0; i < length; i++){
  477 |             if(interface[i].mac && interface[i].mac != '00:00:00:00:00:00'){
  478 |                 mac = interface[i].mac; break;
adamhalasz commented 6 years ago

Hi @Buzut thanks for the bug report. It should be fixed in the latest version v5.0.3.

Thanks, Adam

Buzut commented 6 years ago

Thank you 👍