MCPcopy Create free account
hub / github.com/forwardemail/superagent / isJSON

Function isJSON

src/node/index.js:1808–1812  ·  view source on GitHub ↗

* Check if `mime` is json or has +json structured syntax suffix. * * @param {String} mime * @return {Boolean} * @api private

(mime)

Source from the content-addressed store, hash-verified

1806 */
1807
1808function isJSON(mime) {
1809 // should match /json or +json
1810 // but not /json-seq
1811 return /[/+]json($|[^-\w])/i.test(mime);
1812}
1813
1814/**
1815 * Check if we should follow the redirect `code`.

Callers 2

index.jsFile · 0.70
handleResponseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected