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

Function propertyKeyOf

ark/aot/scope.ts:952–964  ·  view source on GitHub ↗
(property: {
	key: Node
	computed: boolean
})

Source from the content-addressed store, hash-verified

950
951// an object literal property's key, where it's a name
952export const propertyKeyOf = (property: {
953 key: Node
954 computed: boolean
955}): string | undefined =>
956 property.key.type === "Literal" ?
957 (
958 typeof property.key.value === "string" ||
959 typeof property.key.value === "number"
960 ) ?
961 String(property.key.value)
962 : undefined
963 : property.computed || property.key.type !== "Identifier" ? undefined
964 : property.key.name
965
966export const exportNameOf = (node: Node): string =>
967 node.type === "Literal" ?

Callers 15

serverExternalListsInFunction · 0.90
indexFieldsMethod · 0.90
readAtMethod · 0.90
returnFromMethod · 0.90
bindPatternMethod · 0.90
methodOfMethod · 0.90
propertyOfFunction · 0.90
readMethod · 0.90
destructuresPrototypeFunction · 0.90
classMemberKeyOfFunction · 0.90
isNonNullProtoPropertyFunction · 0.90
buildThisReadsContextFunction · 0.90

Calls 1

StringInterface · 0.85

Tested by

no test coverage detected