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

x/bencodex/src/types.ts>areKeysEqual

An alternative take on implementing Bencodex in TypeScript/JavaScript
Latest
function areKeysEqual
import { areKeysEqual } from "https://deno.land/x/bencodex@0.2.2/src/types.ts";

Checks if the given keys have the same type and the same contents. In other words, this function checks if the given keys are encoded in the same Bencodex data.

Parameters

a: Key

A key to compare.

b: Key

Another key to compare.

Returns

boolean

true iff the given keys have the same type and the same contents. It returns false when the given keys have invalid types even if they have the same contents, e.g., areKeysEqual(1n, 1n) returns false.