MCPcopy
hub / github.com/simstudioai/sim / isWorkflowAliasBackingPath

Function isWorkflowAliasBackingPath

apps/sim/lib/copilot/vfs/workflow-aliases.ts:288–306  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

286}
287
288export function isWorkflowAliasBackingPath(path: string): boolean {
289 const trimmedPath = path.trim().replace(/^\/+|\/+$/g, '')
290 let normalizedPath = trimmedPath
291 if (trimmedPath.startsWith('files/')) {
292 try {
293 normalizedPath = `files/${decodeVfsPathSegments(trimmedPath.slice('files/'.length))
294 .map((segment) => normalizeVfsSegment(segment))
295 .join('/')}`
296 } catch {
297 normalizedPath = trimmedPath
298 }
299 }
300 return (
301 normalizedPath === `files/${normalizeVfsSegment(WORKFLOW_CHANGELOG_BACKING_FOLDER)}` ||
302 normalizedPath === `files/${normalizeVfsSegment(WORKFLOW_PLANS_BACKING_FOLDER)}` ||
303 normalizedPath.startsWith(`files/${normalizeVfsSegment(WORKFLOW_CHANGELOG_BACKING_FOLDER)}/`) ||
304 normalizedPath.startsWith(`files/${normalizeVfsSegment(WORKFLOW_PLANS_BACKING_FOLDER)}/`)
305 )
306}
307
308export function isReservedWorkflowAliasBackingDisplayPath(path?: string | null): boolean {
309 if (!path) return false

Calls 4

decodeVfsPathSegmentsFunction · 0.90
normalizeVfsSegmentFunction · 0.90
joinMethod · 0.80
replaceMethod · 0.65

Tested by

no test coverage detected