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

Function runtimeKeyOf

ark/type/standalone/values.ts:153–164  ·  view source on GitHub ↗
(
	value: object | symbol | string
)

Source from the content-addressed store, hash-verified

151
152// named by path, since runtime state differs between builds
153export const runtimeKeyOf = (
154 value: object | symbol | string
155): string | undefined =>
156 typeof value === "string" ? undefined : (
157 (runtimePathsByValue.get(value) ??
158 ((
159 typeof value === "function" &&
160 Reflect.get(globalThis, functionNameOf(value)) === value
161 ) ?
162 `globalThis.${functionNameOf(value)}`
163 : undefined))
164 )
165
166// arktype calls a default's thunk each time it writes the schema
167export const assertBakeableJsonSchema = (root: BaseRoot): void => {

Callers 4

keyOfValueMethod · 0.90
writeFunction · 0.90
describerOfFunction · 0.90
writerOfFunction · 0.90

Calls 2

functionNameOfFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected