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

Function isJSON

src/client.js:273–277  ·  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

271 */
272
273function isJSON(mime) {
274 // should match /json or +json
275 // but not /json-seq
276 return /[/+]json($|[^-\w])/i.test(mime);
277}
278
279/**
280 * Initialize a new `Response` with the given `xhr`.

Callers 1

client.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected