Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.unstable.d.ts>Deno.KvKeyPart

A modern runtime for JavaScript and TypeScript.
Latest
type alias Deno.KvKeyPart
import { type Deno } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.unstable.d.ts";
const { KvKeyPart } = Deno;

UNSTABLE: New API, yet to be vetted.

A single part of a Deno.KvKey. Parts are ordered lexicographically, first by their type, and within a given type by their value.

The ordering of types is as follows:

  1. Uint8Array
  2. string
  3. number
  4. bigint
  5. boolean

Within a given type, the ordering is as follows:

  • Uint8Array is ordered by the byte ordering of the array
  • string is ordered by the byte ordering of the UTF-8 encoding of the string
  • number is ordered following this pattern: -NaN < -Infinity < -100.0 < -1.0 < -0.5 < -0.0 < 0.0 < 0.5 < 1.0 < 100.0 < Infinity < NaN
  • bigint is ordered by mathematical ordering, with the largest negative number being the least first value, and the largest positive number being the last value
  • boolean is ordered by false < true

This means that the part 1.0 (a number) is ordered before the part 2.0 (also a number), but is greater than the part 0n (a bigint), because 1.0 is a number and 0n is a bigint, and type ordering has precedence over the ordering of values within a type.

definition:
| Uint8Array
| string
| number
| bigint
| boolean
| symbol