Beta 7 with some repo names changed.

This commit is contained in:
Luis Fernando Molina committed 2020-11-15 13:05:19 +01:00
1 parent 0f7b40cca7
commit 963c19493a
3408 files changed
+462217 -15516

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
"use strict";
// ----------------------------------------------------------------------------
// There's been a lot of messing with this code...
// The problem is to satisfy the following requirements:
// - properly detect isNode == true on server side and isNode == false in the browser (on client side)
// - make sure create-react-app, react-starter-kit and other react frameworks work
// - make sure it does not break the browserified version (when linked into a html from a cdn)
// - make sure it does not break the webpacking and babel-transpiled scripts
// - make sure it works in Electron
// - make sure it works with Angular.js
// - make sure it does not break other possible usage scenarios
const isBrowser = typeof window !== 'undefined'
const isElectron = typeof process !== 'undefined' &&
typeof process.versions !== 'undefined' &&
typeof process.versions.electron !== 'undefined'
const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && (self instanceof WorkerGlobalScope)
const isWindows = typeof process !== 'undefined' && process.platform === "win32"
const isNode = !(isBrowser || isWebWorker)
const defaultFetch = typeof (fetch) === "undefined" ? require ('../../static_dependencies/fetch-ponyfill/fetch-node') ().fetch : fetch
// ----------------------------------------------------------------------------
module.exports = {
isBrowser,
isElectron,
isWebWorker,
isNode,
isWindows,
defaultFetch,
}