MCPcopy Create free account
hub / github.com/Effect-TS/tsgo / isLayerModuleCall

Function isLayerModuleCall

internal/layergraph/extract.go:350–360  ·  view source on GitHub ↗

isLayerModuleCall checks if a call expression's callee is a Layer module API call (e.g., Layer.provide, Layer.merge, etc.).

(callExpr *ast.CallExpression, layerModuleName string)

Source from the content-addressed store, hash-verified

348// isLayerModuleCall checks if a call expression's callee is a Layer module API call
349// (e.g., Layer.provide, Layer.merge, etc.).
350func isLayerModuleCall(callExpr *ast.CallExpression, layerModuleName string) bool {
351 expr := callExpr.Expression
352 if expr.Kind != ast.KindPropertyAccessExpression {
353 return false
354 }
355 propAccess := expr.AsPropertyAccessExpression()
356 if propAccess.Expression.Kind != ast.KindIdentifier {
357 return false
358 }
359 return scanner.GetTextOfNode(propAccess.Expression) == layerModuleName
360}
361
362// findLayerModuleName resolves the imported identifier name for the "Layer" export
363// from the "effect" package. Falls back to "Layer" if not found.

Callers 1

ExtractLayerGraphFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected