Files
url_tracker_tool/node_modules/fast-equals/recipes/explicit-property-check.md
Andrei 58f8093689 Rebrand from 'Redirect Intelligence v2' to 'URL Tracker Tool V2' throughout UI
- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
2025-08-19 19:12:23 +00:00

878 B

Explicit property check

Sometimes it is necessary to squeeze every once of performance out of your runtime code, and deep equality checks can be a bottleneck. When this is occurs, it can be advantageous to build a custom comparison that allows for highly specific equality checks.

An example where you know the shape of the objects being passed in, where the foo property is a simple primitive and the bar property is a nested object:

import { createCustomEqual } from 'fast-equals';
import type { TypeEqualityComparator } from 'fast-equals';

interface SpecialObject {
  foo: string;
  bar: {
    baz: number;
  };
}

const areObjectsEqual: TypeEqualityComparator<SpecialObject, undefined> = (
  a,
  b,
) => a.foo === b.foo && a.bar.baz === b.bar.baz;

const isSpecialObjectEqual = createCustomEqual({
  createCustomConfig: () => ({ areObjectsEqual }),
});