UNPKG

@visulima/fs

Version:

Human friendly file system utilities for Node.js

28 lines (25 loc) 793 B
'use strict'; var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); class WalkError extends Error { static { __name(this, "WalkError"); } /** File path of the root that's being walked. */ root; /** Constructs a new instance. */ constructor(cause, root) { super(`${cause instanceof Error ? cause.message : cause} for path "${root}"`); this.cause = cause; this.root = root; } // eslint-disable-next-line class-methods-use-this get name() { return "WalkError"; } // eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types set name(_name) { throw new Error("Cannot overwrite name of WalkError"); } } module.exports = WalkError;