UNPKG

@loom-io/core

Version:

A file system wrapper for Node.js and Bun

31 lines (30 loc) 593 B
import { join } from 'path'; export class DirentWrapper { _dir; _dirent; constructor(_dir, _dirent) { this._dir = _dir; this._dirent = _dirent; } isDirectory() { return this.dirent.isDirectory(); } isFile() { return this.dirent.isFile(); } get dirent() { return this._dirent; } get dir() { return this._dir; } get name() { return this.dirent.name; } get parentPath() { return this.dir.path; } get path() { return join(this.dir.path, this.name); } }