function isLexicallyContained
Since 0.1.0
isLexicallyContained(relativePath: string): boolean

Checks if a relative path is lexically contained within a root.

This is a simple lexical check that rejects paths containing '..' segments. For symlink-safe containment, use assertRealPathContained.

Parameters

relativePath: string

The relative path to check

Return Type

boolean

True if the path is contained, false otherwise

Usage

import { isLexicallyContained } from "common/src/index.ts";