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)
| 348 | // isLayerModuleCall checks if a call expression's callee is a Layer module API call |
| 349 | // (e.g., Layer.provide, Layer.merge, etc.). |
| 350 | func 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. |