MCPcopy Index your code
hub / github.com/ampproject/amphtml / normalizeMethod

Function normalizeMethod

src/polyfills/fetch.js:195–207  ·  view source on GitHub ↗

* Normalized method name by uppercasing. * @param {string|undefined} method * @return {string} * @private

(method)

Source from the content-addressed store, hash-verified

193 * @private
194 */
195function normalizeMethod(method) {
196 if (method === undefined) {
197 return 'GET';
198 }
199 method = method.toUpperCase();
200 devAssert(
201 allowedMethods.includes(method),
202 'Only one of %s is currently allowed. Got %s',
203 allowedMethods.join(', '),
204 method
205 );
206 return method;
207}
208
209/**
210 * Provides access to the response headers as defined in the Fetch API.

Callers 1

fetchPolyfillFunction · 0.85

Calls 1

devAssertFunction · 0.90

Tested by

no test coverage detected