class
Noir::JSRouteExtractor
- Noir::JSRouteExtractor
- Reference
- Object
Overview
JSRouteExtractor provides a unified interface for extracting routes from JavaScript files
Defined in:
miniparsers/js_route_extractor.crClass Method Summary
- .extract_body_params(handler_body : String, endpoint : Endpoint)
- .extract_cookie_params(handler_body : String, endpoint : Endpoint)
- .extract_header_params(handler_body : String, endpoint : Endpoint)
- .extract_params_from_context(content : String, pattern : JSRoutePattern, endpoint : Endpoint)
- .extract_query_params(handler_body : String, endpoint : Endpoint)
- .extract_routes(file_path : String, content : String | Nil = nil, debug : Bool = false) : Array(Endpoint)
-
.extract_static_paths(content : String) : Array(Hash(String, String))
Extract static path declarations from JavaScript content Returns array of hashes with static_path (URL prefix) and file_path (directory)
- .find_matching_brace(content : String, open_brace_idx : Int32) : Int32 | Nil
-
.normalize_http_method(method : String) : String
Normalize HTTP method names to standard format
Class Method Detail
def self.extract_params_from_context(content : String, pattern : JSRoutePattern, endpoint : Endpoint)
#
def self.extract_routes(file_path : String, content : String | Nil = nil, debug : Bool = false) : Array(Endpoint)
#
Extract static path declarations from JavaScript content Returns array of hashes with static_path (URL prefix) and file_path (directory)
Normalize HTTP method names to standard format