Node detection: base on process instead of window (#911)

This commit is contained in:
Sam 2019-06-21 09:43:56 -04:00 committed by Daniel Huigens
parent b035f2ea46
commit c7fb8d8fe7
3 changed files with 5 additions and 4 deletions

4
npm-shrinkwrap.json generated
View File

@ -7420,8 +7420,8 @@
} }
}, },
"web-stream-tools": { "web-stream-tools": {
"version": "github:openpgpjs/web-stream-tools#84a497715c9df271a673f8616318264ab42ab3cc", "version": "github:openpgpjs/web-stream-tools#3df197b8db4d4091783cd0160da7d61a3b7a8f3a",
"from": "github:openpgpjs/web-stream-tools#84a497715c9df271a673f8616318264ab42ab3cc", "from": "github:openpgpjs/web-stream-tools#3df197b8db4d4091783cd0160da7d61a3b7a8f3a",
"dev": true "dev": true
}, },
"websocket-driver": { "websocket-driver": {

View File

@ -80,7 +80,7 @@
"pako": "^1.0.6", "pako": "^1.0.6",
"seek-bzip": "github:openpgpjs/seek-bzip#6187fc025851d35c4e104a25ea15a10b9b8d6f7d", "seek-bzip": "github:openpgpjs/seek-bzip#6187fc025851d35c4e104a25ea15a10b9b8d6f7d",
"tweetnacl": "github:openpgpjs/tweetnacl-js#1ef755f2b252a3e328ac739848d00e0dad76be2d", "tweetnacl": "github:openpgpjs/tweetnacl-js#1ef755f2b252a3e328ac739848d00e0dad76be2d",
"web-stream-tools": "github:openpgpjs/web-stream-tools#84a497715c9df271a673f8616318264ab42ab3cc" "web-stream-tools": "github:openpgpjs/web-stream-tools#3df197b8db4d4091783cd0160da7d61a3b7a8f3a"
}, },
"dependencies": { "dependencies": {
"asn1.js": "^5.0.0", "asn1.js": "^5.0.0",

View File

@ -585,7 +585,8 @@ export default {
* Detect Node.js runtime. * Detect Node.js runtime.
*/ */
detectNode: function() { detectNode: function() {
return typeof window === 'undefined'; return typeof global.process === 'object' &&
typeof global.process.versions === 'object';
}, },
/** /**