Skip to content

Support Map.prototype.getOrInsert(), Map.prototype.getOrInsertComputed() types #27380

@rundleman

Description

@rundleman

What version of Bun is running?

1.3.9+cf6cdbbba

What platform is your computer?

Darwin 23.2.0 arm64 arm

What steps can reproduce the bug?

The getOrInsert(), getOrInsertComputed() methods work, but they are not in the types

const options = new Map();
options.getOrInsert('theme', 'light');
console.log(options);

What is the expected behavior?

I expected no typescript errors.

What do you see instead?

ts(2339)
Property 'getOrInsert' does not exist on type 'Map<any, any>'.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtypesAn issue with TypeScript types

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions