Skip to content

Commit b566e8d

Browse files
committed
2.3.2-alpha.0
1 parent 47c59da commit b566e8d

File tree

11 files changed

+39
-24
lines changed

11 files changed

+39
-24
lines changed

typescript/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "covertable",
3-
"version": "2.3.1",
3+
"version": "2.3.2-alpha.0",
44
"description": "A flexible pairwise tool written in TypeScript",
55
"homepage": "https://github.com/walkframe/covertable",
66
"repository": {

typescript/src/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { default as make, sorters, criteria } from '../index';
2-
import { product, combinations, range, len, all, getItems } from '../utils';
2+
import { product, combinations, range, len, all, getItems } from '../lib';
33
import { FactorsType, Scalar, Dict, PairType } from '../types';
44

55
const getPairs = function* (factors: FactorsType, length = 2) {

typescript/src/criteria/greedy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {CriterionArgsType, IncompleteType, PairType} from '../types';
2-
import {getCandidate, combinations, ascOrder, unique} from '../utils';
2+
import {getCandidate, combinations, ascOrder, unique} from '../lib';
33

44
const getNumRemovablePairs = (indexes: Set<number>, incomplete: IncompleteType, length: number) => {
55
let num = 0;

typescript/src/criteria/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

typescript/src/criteria/simple.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {CriterionArgsType, IncompleteType, PairType} from '../types';
2-
import {getCandidate} from '../utils';
2+
import {getCandidate} from '../lib';
33

44
export default function* (
55
incomplete: IncompleteType,

typescript/src/index.ts

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import * as sorters from "./sorters/index";
2-
import * as criteria from "./criteria/index";
3-
import * as exceptions from "./exceptions";
1+
2+
import hash from "./sorters/hash";
3+
import random from "./sorters/random";
4+
5+
import greedy from "./criteria/greedy";
6+
import simple from "./criteria/simple";
7+
8+
import {InvalidCondition} from "./exceptions";
49
import {
510
range,
611
product,
@@ -11,7 +16,8 @@ import {
1116
ascOrder,
1217
primeGenerator,
1318
unique,
14-
} from "./utils";
19+
} from "./lib";
20+
1521
import {
1622
IndicesType,
1723
FactorsType,
@@ -162,7 +168,7 @@ class Row extends Map<Scalar, number> implements RowType {
162168
}
163169
});
164170
if (!this.filled()) {
165-
throw new exceptions.InvalidCondition();
171+
throw new InvalidCondition();
166172
}
167173
return this;
168174
}
@@ -174,8 +180,8 @@ const makeAsync = function* <T extends FactorsType>(
174180
) {
175181
let {
176182
length = 2,
177-
sorter = sorters.hash,
178-
criterion = criteria.greedy,
183+
sorter = hash,
184+
criterion = greedy,
179185
seed = "",
180186
tolerance = 0,
181187
} = options;
@@ -235,6 +241,14 @@ const make = <T extends FactorsType>(factors: T, options: OptionsType = {}) => {
235241
return [...makeAsync(factors, options)];
236242
};
237243

238-
export { make as default, make, makeAsync, sorters, criteria };
244+
const sorters = { hash, random };
245+
const criteria = { greedy, simple };
246+
247+
export {
248+
make as default,
249+
make,
250+
makeAsync,
251+
sorters,
252+
criteria,
253+
};
239254

240-
export { PictConstraintsLexer } from "./utils/pict";

typescript/src/utils.ts renamed to typescript/src/lib.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// @ts-ignore 2307
22
export { hex as md5 } from 'js-md5';
3-
import { FactorsType, Scalar, ParentsType, CandidateType, PairType } from './types';
3+
import {
4+
FactorsType, Scalar, ParentsType, CandidateType, PairType,
5+
} from './types';
46

57
// https://gist.github.com/righ/71e32be8e33f74bde516c06f80c941e8
68

typescript/src/sorters/hash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {md5} from '../utils';
1+
import {md5} from '../lib';
22
import {
33
PairType,
44
SortArgsType,

typescript/src/sorters/index.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)