Skip to content

Commit 4b05050

Browse files
fix(db): use Object.hasOwn for SIM_DB_ROLE validation to avoid prototype keys
1 parent c458c1d commit 4b05050

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/db/db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const DB_POOL_PROFILES = {
2323
type DbRole = keyof typeof DB_POOL_PROFILES
2424

2525
const roleEnv = process.env.SIM_DB_ROLE?.trim()
26-
if (roleEnv && !(roleEnv in DB_POOL_PROFILES)) {
26+
if (roleEnv && !Object.hasOwn(DB_POOL_PROFILES, roleEnv)) {
2727
throw new Error(
2828
`Invalid SIM_DB_ROLE '${roleEnv}' — expected one of ${Object.keys(DB_POOL_PROFILES).join(', ')} (or unset for web)`
2929
)

0 commit comments

Comments
 (0)