better naming
This commit is contained in:
parent
d1b16ce3e1
commit
23c8d4822a
|
|
@ -19,7 +19,7 @@ import { list } from './list'
|
|||
import { math } from './math'
|
||||
import { str } from './str'
|
||||
import { types } from './types'
|
||||
import { isServer } from '#utils/utils'
|
||||
import { runningInBrowser } from '#utils/utils'
|
||||
|
||||
export const globals: Record<string, any> = {
|
||||
date,
|
||||
|
|
@ -32,8 +32,18 @@ export const globals: Record<string, any> = {
|
|||
str,
|
||||
|
||||
// shrimp runtime info
|
||||
$: isServer
|
||||
$: runningInBrowser
|
||||
? {
|
||||
args: [],
|
||||
argv: [],
|
||||
env: {},
|
||||
pid: 0,
|
||||
cwd: '',
|
||||
script: {
|
||||
name: '',
|
||||
path: '.',
|
||||
},
|
||||
} : {
|
||||
args: Bun.argv.slice(3),
|
||||
argv: Bun.argv.slice(1),
|
||||
env: process.env,
|
||||
|
|
@ -44,17 +54,6 @@ export const globals: Record<string, any> = {
|
|||
path: resolve(join('.', Bun.argv[2] ?? '')),
|
||||
},
|
||||
}
|
||||
: {
|
||||
args: [],
|
||||
argv: [],
|
||||
env: {},
|
||||
pid: 0,
|
||||
cwd: '',
|
||||
script: {
|
||||
name: '',
|
||||
path: '.',
|
||||
},
|
||||
},
|
||||
|
||||
// hello
|
||||
echo: (...args: any[]) => {
|
||||
|
|
|
|||
|
|
@ -144,5 +144,4 @@ export const isDebug = (): boolean => {
|
|||
return false
|
||||
}
|
||||
|
||||
export const isBrowser = typeof window !== 'undefined'
|
||||
export const isServer = typeof process !== 'undefined'
|
||||
export const runningInBrowser = typeof window !== 'undefined'
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user