MCPcopy Create free account
hub / github.com/anomalyco/opencode / isSafeSegment

Function isSafeSegment

packages/core/src/skill/discovery.ts:15–24  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

13const fileConcurrency = 8
14
15function isSafeSegment(value: string) {
16 return (
17 value.length > 0 &&
18 value !== "." &&
19 value !== ".." &&
20 !value.includes("/") &&
21 !value.includes("\\") &&
22 !value.includes("\0")
23 )
24}
25
26function isSafeRelativePath(value: string) {
27 const segments = value.split("/")

Callers 1

discovery.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected