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

Binary Data Validator

Build a utility that validates whether two binary data structures contain equal data.

Requirements

Your validator must compare binary data for equality and return a boolean result. The validator should:

  • Accept ArrayBuffer or DataView instances as input
  • Compare the underlying binary data byte-by-byte
  • Return true if the data is identical, false otherwise
  • Handle edge cases like empty buffers correctly

Test Cases

  • Comparing two identical ArrayBuffers with the same byte content returns true @test
  • Comparing two different ArrayBuffers with different byte content returns false @test
  • Comparing two DataViews wrapping identical underlying buffers returns true @test
  • Comparing an ArrayBuffer with a DataView wrapping an identical buffer returns true @test
  • Comparing empty ArrayBuffers returns true @test

Implementation

@generates

API

/**
 * Validates whether two binary data structures are equal.
 *
 * @param {ArrayBuffer|DataView} data1 - First binary data structure
 * @param {ArrayBuffer|DataView} data2 - Second binary data structure
 * @returns {boolean} True if the data structures contain equal binary data, false otherwise
 */
function validateBinaryEquality(data1, data2) {
  // IMPLEMENTATION HERE
}

module.exports = { validateBinaryEquality };

Dependencies { .dependencies }

deep-eql { .dependency }

Provides deep equality comparison support for complex data types including binary data structures.

Install with Tessl CLI

npx tessl i tessl/npm-deep-eql

tile.json