UNPKG

golemio-sdk

Version:
20 lines (19 loc) 774 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultConfigurationParameters = void 0; exports.defaultConfigurationParameters = { /** * Check if the given MIME is a JSON MIME. * JSON MIME examples: * application/json * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json * @param mime - MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ isJsonMime: (mime) => { const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } };