Use is-electron package for accurate environment identification
This commit is contained in:
parent
1b2088c555
commit
01f230e448
1
package-lock.json
generated
1
package-lock.json
generated
@ -10,6 +10,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ipfs-pubsub-1on1": "~0.0.6",
|
||||
"is-electron": "^2.2.0",
|
||||
"is-node": "^1.0.2",
|
||||
"localstorage-down": "^0.6.7",
|
||||
"logplease": "^1.2.14",
|
||||
|
@ -18,6 +18,7 @@
|
||||
"main": "src/OrbitDB.js",
|
||||
"dependencies": {
|
||||
"ipfs-pubsub-1on1": "~0.0.6",
|
||||
"is-electron": "^2.2.0",
|
||||
"is-node": "^1.0.2",
|
||||
"localstorage-down": "^0.6.7",
|
||||
"logplease": "^1.2.14",
|
||||
|
@ -1,16 +1,5 @@
|
||||
/* eslint-disable */
|
||||
// adapted from https://github.com/cheton/is-electron - (c) Cheton Wu
|
||||
const isElectron = () => {
|
||||
if (typeof window !== 'undefined' && typeof window.process === 'object') {
|
||||
return true
|
||||
}
|
||||
|
||||
if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
const isElectron = require('is-electron')
|
||||
|
||||
const fs = (!isElectron() && (typeof window === 'object' || typeof self === 'object')) ? null : eval('require("fs")')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user