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

x/bencodex/src/types.ts>areValuesEqual

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

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

Parameters

A Bencodex value to compare.

Another Bencodex value to compare.

Returns

boolean

true iff the given values have the same type and the same contents. It returns false when the given values have invalid types even if they have the same contents, e.g., areValuesEqual(1, 1) returns false (since numbers are not a valid Bencodex type).