uni-cloud-storage
Version:
uniApp cloud storage api sdk
35 lines (34 loc) • 766 B
text/typescript
type StringObject = { [key:string]: any ,environment:string};
export default function environment ():StringObject {
const overallGlobal =
typeof globalThis !== 'undefined' && typeof globalThis.window === 'undefined' ?
{
environment:'node',
...globalThis
}
:
typeof window !== 'undefined' ?
{
environment:'web',
...window
}
:
typeof global !== 'undefined' ?
{
environment:'node',
...global
}
:
typeof self !== 'undefined' ?
{
environment:'web',
...self
}
:
{
environment:'null',
}
;
return overallGlobal
}
;