function isKvNamespace
Since 0.2.0
isKvNamespace(value: unknown): value is IKvNamespace

Reports whether a binding is KV-shaped.

Used to fail at register() with a name rather than at the first request with a bare TypeError, when a configured binding turns out to be something else (a mistyped name pointing at an R2 bucket, for instance).

Parameters

value: unknown

The binding to check

Return Type

value is IKvNamespace

true when it carries the KV methods

Usage

import { isKvNamespace } from "cloudflare-plugin/src/index.ts";