mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Switch Stork downloads to artifacts that match current runtimes and fix the runtime detection path that Node 22 changed. This keeps the existing Stork pipeline working on Netlify's Noble image and on Apple Silicon development machines.
46 lines
966 B
JavaScript
46 lines
966 B
JavaScript
import has from 'just-has'
|
|
|
|
|
|
export function isNuxt( VueThis ) {
|
|
return has( VueThis, [ '$nuxt' ])
|
|
}
|
|
|
|
export function isBrowserContext () {
|
|
// Node 22 exposes a global navigator, so use window/document instead.
|
|
if ( typeof window === 'undefined' ) return false
|
|
|
|
if ( typeof document === 'undefined' ) return false
|
|
|
|
return true
|
|
}
|
|
|
|
export function hasProcesGlobal () {
|
|
if ( typeof process === 'undefined' ) return false
|
|
|
|
if ( !process.versions?.node ) return false
|
|
|
|
return true
|
|
}
|
|
|
|
|
|
// https://stackoverflow.com/a/8684009/1397641
|
|
export function isDarwin () {
|
|
if ( isBrowserContext() ) return false
|
|
|
|
if ( !hasProcesGlobal() ) return false
|
|
|
|
return process.platform === 'darwin'
|
|
}
|
|
|
|
|
|
export function isLinux () {
|
|
if ( isBrowserContext() ) return false
|
|
|
|
if ( !hasProcesGlobal() ) return false
|
|
|
|
if ( process.platform === 'linux' ) return true
|
|
|
|
if ( process.platform === 'openbsd' ) return true
|
|
|
|
return false
|
|
}
|