Skip to content

Commit

Permalink
Use __proto__ again
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Jan 21, 2025
1 parent 9eb7fc4 commit 1e03883
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/commands/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ type GetOverridesResult = {
overrides: Overrides
}

const getOverridesDataByAgent: Record<Agent, GetOverrides> = {
const getOverridesDataByAgent = <Record<Agent, GetOverrides>>{
__proto__: null,
[BUN](pkgJson: PackageJson) {
const overrides = (pkgJson as any)?.[RESOLUTIONS] ?? {}
return { type: YARN_BERRY, overrides }
Expand Down Expand Up @@ -136,6 +137,7 @@ const lockIncludesByAgent: Record<Agent, AgentLockIncludesFn> = (() => {
}

return {
__proto__: null,
[BUN](lockSrc: string, name: string, lockBasename?: string) {
// This is a bit counterintuitive. When lockBasename ends with a .lockb
// we treat it as a yarn.lock. When lockBasename ends with a .lock we
Expand Down Expand Up @@ -319,6 +321,7 @@ const updateManifestByAgent: Record<Agent, AgentModifyManifestFn> = (() => {
}

return {
__proto__: null,
[BUN]: updateResolutions,
[NPM]: updateOverrides,
[PNPM](editablePkgJson: EditablePackageJson, overrides: Overrides) {
Expand Down Expand Up @@ -388,6 +391,7 @@ const lsByAgent = (() => {
}

return <Record<Agent, AgentListDepsFn>>{
__proto__: null,
async [BUN](agentExecPath: string, cwd: string) {
try {
// Bun does not support filtering by production packages yet.
Expand Down Expand Up @@ -479,6 +483,7 @@ const depsIncludesByAgent: Record<Agent, AgentDepsIncludesFn> = (() => {
}

return {
__proto__: null,
[BUN]: matchHumanStdout,
[NPM]: matchQueryStdout,
[PNPM]: matchQueryStdout,
Expand Down

0 comments on commit 1e03883

Please sign in to comment.