UNPKG

zexson_toolkit

Version:

Zexson Toolkit is a powerful encryption and tokenization library developed by Zexson Team. It offers proprietary encryption algorithms, high-security random token generation, and advanced object comparison features. It includes many advanced security func

28 lines (27 loc) 1.07 kB
import { IsEqualsObjectFunction } from './types'; /** * Deeply compares two objects or arrays for equality, with optional type checking. * * @template T - Generic type extending Record<string, any> * @param {T} obj1 - First object to compare * @param {T} obj2 - Second object to compare * @param {CompareOptions} [options={ checkType: false }] - Comparison options * @param {boolean} options.checkType - When true, compares types instead of values * @returns {boolean} Returns true if objects are equal based on comparison criteria * * @example * // Compare values * const obj1 = { name: "John", age: 30, details: { city: "New York" } } * const obj2 = { name: "John", age: 30, details: { city: "New York" } } * isEqualsObject(obj1, obj2) // true * * // Compare types * const obj3 = { name: "John", age: 25 } * const obj4 = { name: "Jane", age: 30 } * isEqualsObject(obj3, obj4, { checkType: true }) // true * * @since 1.1.2 * @category Comparison * @public */ export declare const isEquals: IsEqualsObjectFunction;