feat: Add better support for non-native errors

This commit is contained in:
Joachim Van Herwegen
2021-06-07 15:54:28 +02:00
parent cefc866109
commit 7cfb87e516
25 changed files with 111 additions and 98 deletions

View File

@@ -156,3 +156,15 @@ export function matchesMediaType(mediaA: string, mediaB: string): boolean {
}
return subTypeA === subTypeB;
}
/**
* Checks if the given content type is an internal content type such as internal/quads.
* Response will be `false` if the input type is undefined.
*
* Do not use this for media ranges.
*
* @param contentType - Type to check.
*/
export function isInternalContentType(contentType?: string): boolean {
return typeof contentType !== 'undefined' && matchesMediaType(contentType, INTERNAL_ALL);
}