UNPKG

@rustable/utils

Version:

Essential utilities for object cloning, string manipulation, and value comparison in TypeScript, inspired by Rust's standard library.

21 lines (18 loc) 359 B
import { stringify } from './stringify.mjs'; "use strict"; function equals(a, b) { if (a === b) { return true; } if (typeof a !== typeof b) { return false; } if (typeof a === "function") { return a === b; } if (a?.constructor !== b?.constructor) { return false; } return stringify(a) === stringify(b); } export { equals };