Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
poef committed Apr 4, 2024
1 parent 4fb554e commit a006212
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/oldm.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/oldm.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@muze-nl/oldm",
"version": "0.2.0",
"version": "0.2.1",
"description": "Object - Linked Data Mapper",
"type": "module",
"source": [
Expand Down
8 changes: 4 additions & 4 deletions src/oldm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ class Parser {

constructor(options = {}) {
this.prefixes = options?.prefixes ?? {}
this.seperator = options?.seperator ?? '$' //TODO: do I really want to allow different seperators? least surprise etc.
this.separator = options?.separator ?? '$' //TODO: do I really want to allow different separators? least surprise etc.
if (!this.prefixes['xsd']) {
this.prefixes['xsd'] = 'http://www.w3.org/2001/XMLSchema#'
}
this.types = {}
Object.entries(xsdTypes).forEach(([t,v]) => {
const ts = t
.split('$')
.join(this.seperator)
.join(this.separator)
this.types[ts] = v
})
}
Expand Down Expand Up @@ -82,7 +82,7 @@ class Parser {
let prefixes = this.prefixes
for (let prefix in prefixes) {
if (uri.startsWith(prefixes[prefix])) {
return new JSONTag.Link(prefix+this.seperator+uri.substring(prefixes[prefix].length))
return new JSONTag.Link(prefix+this.separator+uri.substring(prefixes[prefix].length))
}
}
return uri
Expand All @@ -91,7 +91,7 @@ class Parser {
long(uri) {
if (uri instanceof JSONTag.Link) {
uri = uri.value
let [prefix,short] = uri.split(this.seperator)
let [prefix,short] = uri.split(this.separator)
if (this.prefixes[prefix]) {
uri = this.prefixes[prefix]+short
}
Expand Down

0 comments on commit a006212

Please sign in to comment.