Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up unused interfaces and update dependencies #79

Merged
merged 10 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update js-combinatorics to v2
Replaced the use of `bigCombination` by the new `Combination` iterator.
The library can now handle big arrays without the need for a specific
`big` function.

Change-type: patch
pipex committed Jan 13, 2025
commit 434e65a01e12b9ba26e51be97a0b36ee0c097053
4 changes: 2 additions & 2 deletions lib/contract.ts
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import range from 'lodash/range';
import reduce from 'lodash/reduce';
import some from 'lodash/some';
import uniqWith from 'lodash/uniqWith';
import { bigCombination } from 'js-combinatorics';
import { Combination } from 'js-combinatorics';
import { compare, satisfies, valid, validRange } from 'semver';

import { isValid } from './json-schema';
@@ -896,7 +896,7 @@ export default class Contract {
Math.min(cardinality.to, contracts.length) + 1,
);
return flatMap(rang, (tcardinality) => {
return bigCombination(contracts, tcardinality).toArray();
return new Combination(contracts, tcardinality).toArray();
});
}
/**
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
"ajv-formats": "^3.0.1",
"debug": "^3.2.6",
"handlebars": "^4.7.8",
"js-combinatorics": "^0.5.5",
"js-combinatorics": "^2.1.2",
"json-schema": "^0.4.0",
"lodash": "^4.17.19",
"object-hash": "^1.3.1",
@@ -50,7 +50,6 @@
"@types/chai": "^4.2.11",
"@types/chai-as-promised": "^7.1.2",
"@types/debug": "^4.1.5",
"@types/js-combinatorics": "^0.5.32",
"@types/json-schema": "^7.0.15",
"@types/lodash": "^4.14.168",
"@types/mocha": "^10.0.6",
1 change: 1 addition & 0 deletions typings/js-combinatorics.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'js-combinatorics';