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)
interface MapLike

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

Type Parameters

Methods

get(key: K): V | undefined
set(
key: K,
value: V,
): void
has(key: K): boolean

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.

Add Package

deno add jsr:@thai/get-or-create

Import symbol

import { type MapLike } from "@thai/get-or-create";
or

Import directly with a jsr specifier

import { type MapLike } from "jsr:@thai/get-or-create";

Add Package

pnpm i jsr:@thai/get-or-create
or (using pnpm 10.8 or older)
pnpm dlx jsr add @thai/get-or-create

Import symbol

import { type MapLike } from "@thai/get-or-create";

Add Package

yarn add jsr:@thai/get-or-create
or (using Yarn 4.8 or older)
yarn dlx jsr add @thai/get-or-create

Import symbol

import { type MapLike } from "@thai/get-or-create";

Add Package

vlt install jsr:@thai/get-or-create

Import symbol

import { type MapLike } from "@thai/get-or-create";

Add Package

npx jsr add @thai/get-or-create

Import symbol

import { type MapLike } from "@thai/get-or-create";

Add Package

bunx jsr add @thai/get-or-create

Import symbol

import { type MapLike } from "@thai/get-or-create";