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-9/

Data Validation Utility

A utility module for validating scientific measurement data that may contain NaN (Not a Number) values. The module should properly compare measurement objects including their NaN values to determine if datasets are equivalent.

Capabilities

Compare measurement objects with NaN values

  • When comparing two objects where both have NaN values in the same field, they should be considered equal @test
  • When comparing two objects where one has NaN and the other has a number in the same field, they should be considered not equal @test
  • When comparing two nested objects that both contain NaN values in corresponding fields, they should be considered equal @test

Validate dataset equivalence

  • When comparing two arrays of measurement objects that contain identical NaN values in corresponding positions, they should be considered equal @test
  • When comparing two arrays where NaN appears in different positions, they should be considered not equal @test

Implementation

@generates

API

/**
 * Compares two measurement objects or datasets for deep equality,
 * treating NaN values as equal when they appear in the same locations.
 *
 * @param {any} dataset1 - The first dataset to compare
 * @param {any} dataset2 - The second dataset to compare
 * @returns {boolean} True if the datasets are deeply equal (including NaN equality), false otherwise
 */
function compareDatasets(dataset1, dataset2) {
  // IMPLEMENTATION HERE
}

module.exports = {
  compareDatasets
};

Dependencies { .dependencies }

deep-eql { .dependency }

Provides deep equality comparison with proper NaN handling.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-deep-eql

tile.json