Skip to content

Commit

Permalink
fix: no namespace builder usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Mar 30, 2024
1 parent 80d30db commit 0bc7415
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The `factory` parameter is required, and must be an [RDF/JS Environment](https:/

- [DatasetCoreFactory](https://npm.im/@rdfjs/dataset)
- [DataFactory](https://npm.im/@rdfjs/data-model)
- [NamespaceFactory](https://npm.im/@rdfjs/namespace)
- [TermSetFactory](https://npm.im/@rdfjs/term-set)
- [ClownfaceFactory](https://npm.im/clownface)
- [NsBuildersFactory](https://npm.im/@tpluscode/rdf-ns-builders)
Expand Down
3 changes: 2 additions & 1 deletion lib/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type { TermSetFactory } from '@rdfjs/term-set/Factory.js'
import type ClownfaceFactory from 'clownface/Factory.js'
import type NsBuildersFactory from '@tpluscode/rdf-ns-builders'
import type FsUtilsFactory from '@zazuko/rdf-utils-fs/Factory.js'
import type { NamespaceFactory } from '@rdfjs/namespace/Factory.js'

type Factory<D extends DatasetCore = DatasetCore> = Environment<DatasetCoreFactory<Quad, Quad, D> | DataFactory | TermSetFactory | ClownfaceFactory | NsBuildersFactory | FsUtilsFactory>
type Factory<D extends DatasetCore = DatasetCore> = Environment<DatasetCoreFactory<Quad, Quad, D> | DataFactory | TermSetFactory | ClownfaceFactory | NsBuildersFactory | FsUtilsFactory | NamespaceFactory>

export default Factory
2 changes: 1 addition & 1 deletion lib/middleware/operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { RequestHandler, Router, Response } from 'express'
import type { GraphPointer, MultiPointer } from 'clownface'
import createError from 'http-errors'
import { isGraphPointer } from 'is-graph-pointer'
import { code } from '../namespaces.js'
import log from '../log.js'
import { HydraBoxMiddleware } from '../../middleware.js'
import { Api } from '../../Api.js'
Expand Down Expand Up @@ -122,6 +121,7 @@ const prepareOperation: RequestHandler = function (req, res, next) {

const invokeOperation: OperationRequestHandler = async (req, res, next) => {
const { api } = req.hydra
const code = api.env.namespace('https://code.described.at/')

if (!req.hydra.operation) {
const operationMap = mapOperations({ api, res })
Expand Down
4 changes: 0 additions & 4 deletions lib/namespaces.ts

This file was deleted.

0 comments on commit 0bc7415

Please sign in to comment.