or run

tessl search
Log in

Version

Files

tile.json

task.mdevals/scenario-8/

File System Validator

Build a utility that validates the presence of required files and directories in a project structure.

Capabilities

Path Existence Validation

  • Given path "/config/app.json" that exists, validatePath returns true @test
  • Given path "/src" that exists, validatePath returns true @test
  • Given path "/missing.txt" that does not exist, validatePath returns false @test

Batch Validation

  • Given paths ["/package.json", "/README.md"], both existing, validatePaths returns [true, true] @test
  • Given paths ["/existing.txt", "/missing.txt"], only first exists, validatePaths returns [true, false] @test

Implementation

@generates

API

/**
 * Checks if a single path (file or directory) exists.
 *
 * @param {string} path - The file or directory path to check
 * @returns {boolean} true if the path exists, false otherwise
 */
function validatePath(path) {
  // IMPLEMENTATION HERE
}

/**
 * Validates multiple paths and returns their existence status.
 *
 * @param {string[]} paths - Array of file or directory paths to check
 * @returns {boolean[]} Array of booleans indicating existence of each path
 */
function validatePaths(paths) {
  // IMPLEMENTATION HERE
}

module.exports = {
  validatePath,
  validatePaths
};

Dependencies { .dependencies }

metro-memory-fs { .dependency }

Provides in-memory filesystem operations for testing purposes.