Skip to main content
Home

Built and signed on GitHub Actions

Convenience function to get or create a value in a map

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (0.0.5)
f
getOrCreate

Gets the value associated with the specified key from the map. If the key does not exist, creates a new value using the provided createValue function, associates it with the key in the map, and returns the new value.

I
MapLike

A map-like object that can be used with the getOrCreate function.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.