CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-deep-eql

Improved deep equality testing for Node.js and the browser with support for complex types and circular references.

Overall
score

96%

Overview
Eval results
Files

task.mdevals/scenario-2/

Numeric Value Comparator

A utility for comparing numeric values in objects with special handling for edge cases like signed zeros.

Capabilities

Compare objects with signed zero values

  • It returns false when comparing objects containing positive zero and negative zero in the same field @test
  • It returns true when comparing objects both containing positive zero in the same field @test
  • It returns true when comparing objects both containing negative zero in the same field @test

Handle arrays with signed zeros

  • It returns false when comparing arrays where one contains -0 and the other contains +0 at the same index @test

Implementation

@generates

API

/**
 * Compares two values for deep equality, distinguishing between +0 and -0.
 *
 * @param {any} value1 - The first value to compare.
 * @param {any} value2 - The second value to compare.
 * @returns {boolean} True if the values are deeply equal (with -0 !== +0), false otherwise.
 */
function compareValues(value1, value2) {
  // IMPLEMENTATION HERE
}

module.exports = {
  compareValues
};

Dependencies { .dependencies }

deep-eql { .dependency }

Provides deep equality testing with signed zero distinction support.

Install with Tessl CLI

npx tessl i tessl/npm-deep-eql

tile.json