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

Function commonJsExportOf

ark/aot/scope.ts:916–923  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

914
915// e.g. `a` for `exports.a` or `module.exports.a`
916const commonJsExportOf = (node: Node): string | undefined =>
917 (
918 node.type === "MemberExpression" &&
919 !node.computed &&
920 isCommonJsExports(node.object)
921 ) ?
922 node.property.name
923 : undefined
924
925// e.g. `./a` for `require("./a")`, or for `wrapper(require("./a"))`
926const requiredBy = (node: Node, wrapper?: string): string | undefined => {

Callers 1

readCommonJsMethod · 0.85

Calls 1

isCommonJsExportsFunction · 0.70

Tested by

no test coverage detected