DamonOehlman / detect-browser

Unpack a browser type and version from the useragent string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typing leakage on global environment variable.

CyrilQuandalle opened this issue · comments

commented

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 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.

Same issue due to /// <reference types="node" /> in the package d.ts. I think removing node from types in your tsconfig should fix it

"types": ["node"]