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

Function nativeVersionOf

ark/aot/declareNative.ts:76–83  ·  view source on GitHub ↗
(require: NodeJS.Require, entry: string)

Source from the content-addressed store, hash-verified

74 [join(cwd, "package.json"), import.meta.url].map(from => createRequire(from))
75
76const nativeVersionOf = (require: NodeJS.Require, entry: string) => {
77 const name = entry.split("/")[0]
78 try {
79 return require(`${name}/package.json`).version as string
80 } catch {
81 return
82 }
83}
84
85// TypeScript 7.0 has no API
86const isNativeVersion = (version: string) =>

Callers 2

installedNativeCheckerFunction · 0.85
loadNativeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected