MCPcopy Create free account
hub / github.com/arktypeio/arktype / isWithinDir

Function isWithinDir

ark/type/cli.ts:190–199  ·  view source on GitHub ↗
(root: string, target: string)

Source from the content-addressed store, hash-verified

188}
189
190const isWithinDir = (root: string, target: string): boolean => {
191 const rel = relative(root, target)
192 return (
193 rel === "" ||
194 (rel !== ".." &&
195 !rel.startsWith(`..${sep}`) &&
196 !rel.startsWith("../") &&
197 !isAbsolute(rel))
198 )
199}
200
201const resolveSafeSkillDir = (
202 projectRoot: string,

Callers 2

resolveSafeSkillDirFunction · 0.85
prepareSkillInstallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected