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

Function detectMigrationSource

ark/type/cli.ts:147–165  ·  view source on GitHub ↗
(
	manifest: PackageManifest | undefined
)

Source from the content-addressed store, hash-verified

145]
146
147export const detectMigrationSource = (
148 manifest: PackageManifest | undefined
149): MigrationSource | undefined => {
150 const deps = { ...manifest?.dependencies, ...manifest?.devDependencies }
151 if ("zod" in deps) return "zod"
152 if ("valibot" in deps) return "valibot"
153 if ("yup" in deps) return "yup"
154 if ("joi" in deps) return "joi"
155 if ("@sinclair/typebox" in deps || "typebox" in deps) return "typebox"
156 const arkVer = deps.arktype
157 if (arkVer) {
158 const normalized = arkVer.replace(/([<>]=?|=|\^|~)\s+/g, "$1")
159 if (
160 /(?:^|[\s|]|workspace:)(?:[<>]=|=|\^|~)?v?2(?=$|[\s.|-])/.test(normalized)
161 )
162 return "v2"
163 }
164 return undefined
165}
166
167const defaultSkillTarget = (projectRoot: string): string => {
168 if (

Callers 2

cli.test.tsFile · 0.90
runMigrateFunction · 0.85

Calls 2

replaceMethod · 0.80
testMethod · 0.80

Tested by

no test coverage detected