Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function LdpStore (options) {
options = options || {}
this.parsers = options.parsers ? new rdf.Parsers(options.parsers) : rdf.parsers
this.serializers = options.serializers ? new rdf.Serializers(options.serializers) : rdf.serializers
this.defaultParser = options.defaultParser || 'text/turtle'
this.defaultSerializer = options.defaultSerializer || 'text/turtle'
this.defaultPatchSerializer = options.defaultPatchSerializer || options.defaultSerializer || 'text/turtle'
this.request = options.request || rdf.defaultRequest
}
public create (baseIRI?: string) {
const parsersInit = Object.entries(this.parsers)
.reduce((result, value) => {
result[value[0]] = value[1](baseIRI)
return result
}, {})
return new $rdf.Parsers(parsersInit)
}
}