Skip to content

Commit

Permalink
update to also include cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvercr committed Aug 26, 2024
1 parent ee17097 commit ab56034
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"description": "",
"scripts": {
"build": "tsc && tsc-alias",
"build": "tsc && tsc-alias && rollup ./dist/index.js --file ./dist/index.cjs --format cjs",
"test": "vitest run --coverage --coverage.include src",
"prepare": "husky"
},
Expand Down
3 changes: 2 additions & 1 deletion src/shacl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function toLens(
}),
);
}
if (maxCount < 2) return field.path.one().then(field.extract);

const thenListExtract = RdfList.and(empty<Cont>()).map(
([terms, { quads }]) => terms.map((id) => ({ id, quads })),
Expand Down Expand Up @@ -394,7 +395,7 @@ function extractProperty(
export const CBDLens = new BasicLensM<Cont, Quad>(({ id, quads }) => {
const done = new Set<string>();
const todo = [id];
const out = [];
const out: Quad[] = [];
let item = todo.pop();
while (item) {
const found = quads.filter((x) => x.subject.equals(item));
Expand Down
1 change: 1 addition & 0 deletions test/shacl2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ ${prefixes}
[ a js:Point; <string> "6"; ]
).
`;

const output = extractShapes(parseQuads(shapes));

const quads = parseQuads(data);
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"preserveConstEnums": true,
"downlevelIteration": true,
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
"strict": true,
"strictFunctionTypes": false,
"strictPropertyInitialization": false,
Expand Down

0 comments on commit ab56034

Please sign in to comment.