better naming

This commit is contained in:
Corey Johnson 2026-01-05 13:38:11 -08:00
parent d1b16ce3e1
commit 23c8d4822a
2 changed files with 13 additions and 15 deletions

View File

@ -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[]) => {

View File

@ -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'