mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-10-07 22:57:07 +00:00
Use is-electron package for accurate environment identification
This commit is contained in:
@@ -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")')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user