Skip to content

Commit

Permalink
Export factory helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
Fletcher91 committed Apr 1, 2020
1 parent 6eaeb45 commit 5385544
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/factoryHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import rdfFactory, { Feature, Quad, Term } from "@ontologies/core";

/** @internal */
export const equals = rdfFactory.supports[Feature.identity]
? (a: any, b: any): boolean => a === b
: rdfFactory.supports[Feature.idStamp]
Expand All @@ -10,6 +11,7 @@ const noIdError = (obj: any): void => {
throw new TypeError(`Factory has idStamp feature, but the property wasn't present on ${obj}`);
};

/** @internal */
export const id = rdfFactory.supports[Feature.idStamp]
? (obj?: Term | Quad | any): number => (obj as any)?.id || noIdError(obj)
: (obj?: Term | Quad | any): number => rdfFactory.id(obj);
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { LinkedRenderStore } from "./LinkedRenderStore";

export { createStore } from "./createStore";
/** @internal */
export * from "./factoryHelpers";
export { linkMiddleware } from "./linkMiddleware";
export { DataProcessor } from "./processor/DataProcessor";
export { RequestInitGenerator } from "./processor/RequestInitGenerator";
Expand Down

0 comments on commit 5385544

Please sign in to comment.