Skip to content

Commit ccad8d2

Browse files
author
Daniel Beeke
committed
scrubbing contents
1 parent 7aed791 commit ccad8d2

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shapething/localstore",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"license": "MIT",
55
"exports": "./lib/LocalStore.ts"
66
}

lib/LocalStore.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ export class LocalStore implements Source, RdfJsStore {
347347
async #parseAndStoreGraph(graph: NamedNode | DefaultGraph, fileHandle: FileSystemFileHandle) {
348348
const parser = new Parser({ baseIRI: graph.value })
349349
const contents = await (await fileHandle.getFile()).text()
350-
const quads = await parser.parse(contents)
350+
const strippedContents = contents.replace(/\<([a-z.\/#]*)\.ttl([a-z.\/#]*)\>/g, '<$1$2>')
351+
const quads = await parser.parse(strippedContents)
351352
this.#cache.addQuads(quads.map(quad => factory.quad(quad.subject, quad.predicate, quad.object, graph)))
352353
}
353354

0 commit comments

Comments
 (0)