UNPKG

denoify

Version:

For NPM module authors that would like to support Deno but do not want to write and maintain a port.

14 lines (9 loc) 322 B
import * as path from "path"; export function isInsideOrIsDir(params: { dirPath: string; fileOrDirPath: string }) { const { dirPath, fileOrDirPath } = params; const relative = path.relative(dirPath, fileOrDirPath); if (relative === "") { return true; } return !relative.startsWith(".."); }