Skip to content

Commit

Permalink
revert: import
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Oct 2, 2024
1 parent 254d48e commit ca41d71
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions packages/editor-base/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import ns from '@tpluscode/rdf-ns-builders'
import { html, css, LitElement } from 'lit'
import '@vanillawc/wc-codemirror'
import { debounce } from 'throttle-debounce'
Expand Down Expand Up @@ -146,6 +145,8 @@ export default class Editor extends LitElement {

get _prefixes() {
return async () => {
const ns = await import('@tpluscode/rdf-ns-builders')

const prefixes = (this.prefixes || '')
.split(',')
.map(prefix => prefix.trim())
Expand Down Expand Up @@ -308,23 +309,20 @@ export default class Editor extends LitElement {
}

async _combinePrefixes() {
return Object.entries(this.customPrefixes).reduce(
(clean, [prefix, namespace]) => {
if (
!namespace ||
!prefix ||
typeof namespace !== 'string' ||
typeof prefix !== 'string'
) {
return clean
}
return Object.entries(this.customPrefixes).reduce((clean, [prefix, ns]) => {
if (
!ns ||
!prefix ||
typeof ns !== 'string' ||
typeof prefix !== 'string'
) {
return clean
}

return {
...clean,
[prefix]: namespace,
}
},
await this._prefixes()
)
return {
...clean,
[prefix]: ns,
}
}, await this._prefixes())
}
}

0 comments on commit ca41d71

Please sign in to comment.