detect-browser icon indicating copy to clipboard operation
detect-browser copied to clipboard

Typing leakage on global environment variable.

Open CyrilQuandalle opened this issue 3 years ago • 2 comments

Hi.

I have just installed the version 5.3.0 of the library, and as soon as I do an import of it the typing of any variable in process.env (ex : process.env.MYVAR) goes from any to string | undefined.

Is it intentional ? I think that a library shouldn't have that kind of side effect.

Thanks in advance for your answer

CyrilQuandalle avatar Aug 02 '22 12:08 CyrilQuandalle

@CyrilQuandalle agreed - if that is the case, that is very much unwanted. Will have a look at the typings and see if I can get to the bottom of things.

DamonOehlman avatar Oct 06 '22 00:10 DamonOehlman

Same issue due to /// <reference types="node" /> in the package d.ts. I think removing node from types in your tsconfig should fix it https://github.com/DamonOehlman/detect-browser/blob/546e6f1348375d8a486f21da07b20717267f6c49/tsconfig.json#L10

jer-sen avatar May 25 '23 16:05 jer-sen