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

x/bencodex/src/types.ts>areDictionariesEqual

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

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

Parameters

A dictionary to compare.

Another dictionary to compare.

Returns

boolean

true iff the given dictionaries have the same keys and the same associated values. It returns false when the given dictionaries have invalid types even if they have the same keys and the same associated values, e.g., areDictionariesEqual(1n, 1n) returns false.