Home / Function/ normalizeAndValidateMethod() — fastify Function Reference

normalizeAndValidateMethod() — fastify Function Reference

Architecture documentation for the normalizeAndValidateMethod() function in route.js from the fastify codebase.

Entity Profile

Dependency Diagram

graph TD
  8b1cd528_68cd_394e_a8b4_055f91a6e22c["normalizeAndValidateMethod()"]
  de54192b_022b_f89b_5a43_a2593cb4df49["route.js"]
  8b1cd528_68cd_394e_a8b4_055f91a6e22c -->|defined in| de54192b_022b_f89b_5a43_a2593cb4df49
  style 8b1cd528_68cd_394e_a8b4_055f91a6e22c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/route.js lines 573–584

function normalizeAndValidateMethod (method) {
  if (typeof method !== 'string') {
    throw new FST_ERR_ROUTE_METHOD_INVALID()
  }
  method = method.toUpperCase()
  if (!this[kSupportedHTTPMethods].bodyless.has(method) &&
    !this[kSupportedHTTPMethods].bodywith.has(method)) {
    throw new FST_ERR_ROUTE_METHOD_NOT_SUPPORTED(method)
  }

  return method
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does normalizeAndValidateMethod() do?
normalizeAndValidateMethod() is a function in the fastify codebase, defined in lib/route.js.
Where is normalizeAndValidateMethod() defined?
normalizeAndValidateMethod() is defined in lib/route.js at line 573.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free