Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as inferences from './inferences'
interface ConverterMap {
[type: string]: (value: string, type: string) => unknown;
}
export interface IMediaTypeProcessor {
canProcess(mediaType: string);
process(
alcaeus: IHydraClient,
uri: string,
response: IResponseWrapper,
apiDocumentation?: ApiDocumentation): Promise;
}
const jsonldSerializer = new JsonLdSerializer()
const parserFactory = new ParserFactory()
function isRdfList (resource) {
let isObject = typeof resource === 'object'
if (isObject) {
const isEmpty = resource[Constants.JsonLd.Id] === rdf.nil
const isListNode = rdf.first in resource && rdf.rest in resource
return isEmpty || isListNode
}
return false
}
async function parseAndNormalizeGraph (responseText: string, uri: string, mediaType: string): Promise {
const parsers = parserFactory.create(uri)