CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-is-buffer

Determine if an object is a Buffer without including the full buffer module

93

1.02x
Quality

Pending

Does it follow best practices?

Impact

93%

1.02x

Average score across 9 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

task.mdevals/scenario-1/

Buffer Type Validator

A utility module that validates input data types for buffer processing operations. The module ensures that only valid buffer-like data structures are accepted for processing.

Capabilities

Input Type Validation

Validates that input data is of the correct type before processing.

  • When passed null, the validator returns false @test
  • When passed undefined, the validator returns false @test
  • When passed a string like "hello", the validator returns false @test
  • When passed a number like 42, the validator returns false @test
  • When passed a boolean like true, the validator returns false @test
  • When passed a plain object like {}, the validator returns false @test
  • When passed an array like [1, 2, 3], the validator returns false @test
  • When passed a function, the validator returns false @test

Buffer Type Acceptance

Correctly identifies and accepts actual Buffer instances.

  • When passed a Buffer created with Buffer.from([1, 2, 3]), the validator returns true @test
  • When passed a Buffer created with Buffer.alloc(10), the validator returns true @test

Implementation

@generates

API

/**
 * Validates whether the input is a Buffer.
 *
 * @param {*} data - The input to validate
 * @returns {boolean} true if input is a Buffer, false otherwise
 */
function validateBuffer(data) {
  // Implementation here
}

module.exports = { validateBuffer };

Dependencies { .dependencies }

is-buffer { .dependency }

Provides buffer type detection functionality.

@satisfied-by

tile.json