Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/pogo/lib/util/is-path-inside.ts>default

Server framework for Deno
Latest
variable default
import { default } from "https://deno.land/x/pogo@v0.6.0/lib/util/is-path-inside.ts";

Returns true if childPath is a descendant of parentPath. Otherwise returns false, including if both paths are equal. The paths are resolved and normalized before comparing them but symlinks are not followed and neither path needs to exist on disk.

Use isPathInside.fs() instead to also follow symlinks, which requires filesystem access.

type

(childPath: string, parentPath: string) => boolean