nk2028 / opencc-js

The JavaScript version of Open Chinese Convert (OpenCC)
https://www.npmjs.com/package/opencc-js
MIT License
245 stars 23 forks source link

Properly detect node environment #7

Closed dlackty closed 3 years ago

dlackty commented 3 years ago

Current implementation detects node environment by checking if window is undefined but it fails at case of web workers. I copied the implementation from emscripten., which checks existances of node-specific classes.

ayaka14732 commented 3 years ago

Published v0.3.6.