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

Method declaredParamKindOf

ark/aot/graph.ts:2644–2661  ·  view source on GitHub ↗
(
		fn: FunctionNode,
		index: number,
		module: SourceModule,
		kindOfKey: KindOfKey
	)

Source from the content-addressed store, hash-verified

2642 // which tsc or a bundler wrote beside it, so a package's built output is
2643 // read as its declarations annotate it
2644 private declaredParamKindOf(
2645 fn: FunctionNode,
2646 index: number,
2647 module: SourceModule,
2648 kindOfKey: KindOfKey
2649 ): KindBits | undefined {
2650 const declarations = this.declarationsOf(module)
2651 if (!declarations) return
2652 const name = exportedFunctionNameOf(fn, module)
2653 if (name === undefined) return
2654 const param = declaredParamsOf(declarations, name)?.[index]
2655 if (!param) return
2656 return this.annotatedKindOf(
2657 param.type === "AssignmentPattern" ? param.left : param,
2658 declarations,
2659 kindOfKey
2660 )
2661 }
2662
2663 // the .d.ts beside a JS module, where its build wrote one
2664 private declarationsOf(module: SourceModule): SourceModule | undefined {

Callers 1

paramKindOfMethod · 0.95

Calls 4

declarationsOfMethod · 0.95
annotatedKindOfMethod · 0.95
exportedFunctionNameOfFunction · 0.85
declaredParamsOfFunction · 0.85

Tested by

no test coverage detected