MCPcopy
hub / github.com/ampproject/amphtml / normalizeMethod_

Function normalizeMethod_

third_party/subscriptions-project/swg.js:13461–13475  ·  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

13459 * @private
13460 */
13461function normalizeMethod_(method) {
13462 if (method === undefined) {
13463 return 'GET';
13464 }
13465 method = method.toUpperCase();
13466
13467 assert(
13468 allowedMethods_.includes(method),
13469 'Only one of %s is currently allowed. Got %s',
13470 allowedMethods_.join(', '),
13471 method
13472 );
13473
13474 return method;
13475}
13476
13477/**
13478 * Sets up and normalizes the FetchInitDef

Callers 1

setupInitFunction · 0.70

Calls 1

assertFunction · 0.70

Tested by

no test coverage detected