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

Function isCommonJsExports

ark/aot/scope.ts:906–913  ·  view source on GitHub ↗
(node: Node | undefined)

Source from the content-addressed store, hash-verified

904} as const satisfies KeySet
905
906const isCommonJsExports = (node: Node | undefined): boolean =>
907 node?.type === "Identifier" ? node.name === "exports"
908 : node?.type === "MemberExpression" ?
909 !node.computed &&
910 node.object.type === "Identifier" &&
911 node.object.name === "module" &&
912 node.property.name === "exports"
913 : false
914
915// e.g. `a` for `exports.a` or `module.exports.a`
916const commonJsExportOf = (node: Node): string | undefined =>

Callers 2

readCommonJsMethod · 0.70
commonJsExportOfFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected