Skip to content

Commit 8508c34

Browse files
⬆️ deps: Upgrade.
1 parent bba98bd commit 8508c34

13 files changed

+50
-112
lines changed

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,15 @@
6464
},
6565
"dependencies": {},
6666
"devDependencies": {
67-
"@aureooms/js-array": "4.0.0",
68-
"@aureooms/js-compare": "2.0.1",
69-
"@aureooms/js-functools": "2.0.3",
70-
"@aureooms/js-itertools": "5.1.1",
71-
"@aureooms/js-memory": "4.0.0",
72-
"@aureooms/js-red-black-tree": "9.0.0",
73-
"@aureooms/js-type": "1.0.4",
7467
"@babel/core": "7.14.6",
7568
"@babel/preset-env": "7.14.7",
7669
"@babel/register": "7.14.5",
7770
"@commitlint/cli": "12.1.4",
71+
"@iterable-iterator/list": "^1.0.1",
72+
"@iterable-iterator/range": "^2.0.1",
73+
"@iterable-iterator/sorted": "^1.0.0",
7874
"@js-library/commitlint-config": "0.0.4",
75+
"@total-order/primitive": "^1.0.1",
7976
"ava": "3.15.0",
8077
"babel-plugin-transform-remove-console": "6.9.4",
8178
"babel-plugin-unassert": "3.1.0",

test/src/choice.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import test from 'ava';
22
import {choice, _choice, randint} from '../../src/index.js';
33

4-
import {_calloc} from '@aureooms/js-memory';
5-
import {iota, copy} from '@aureooms/js-array';
4+
import {range} from '@iterable-iterator/range';
65

76
const macro = (t, type, _, choice, n, i, j) => {
8-
const calloc = _calloc(type);
9-
const a = calloc(n);
10-
const b = calloc(n);
11-
12-
iota(a, 0, n, 0);
13-
copy(a, 0, n, b, 0);
7+
const a = type.from(range(n));
8+
const b = type.from(a);
149

1510
const x = choice(b, i, j);
1611

test/src/randfloat.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import test from 'ava';
22
import {randfloat} from '../../src/index.js';
33

4-
import type from '@aureooms/js-type';
5-
64
test('randfloat', (t) => {
75
let r;
86

@@ -13,7 +11,7 @@ test('randfloat', (t) => {
1311
const check = () => {
1412
t.true(r < rj, `${r} < ${rj}`);
1513
t.true(r >= ri, `${r} >= ${ri}`);
16-
t.true(type.isfinite(r), `type.isfinite(${r})`);
14+
t.true(Number.isFinite(r), `Number.isFinite(${r})`);
1715
};
1816

1917
for (let i = 0; i < n; ++i) {

test/src/randint.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import test from 'ava';
22
import {randint} from '../../src/index.js';
33

4-
import type from '@aureooms/js-type';
5-
64
test('randint', (t) => {
75
let r;
86

@@ -13,7 +11,7 @@ test('randint', (t) => {
1311
const check = () => {
1412
t.true(r < rj, `${r} < ${rj}`);
1513
t.true(r >= ri, `${r} >= ${ri}`);
16-
t.true(type.isint(r), `type.isint(${r})`);
14+
t.true(Number.isInteger(r), `Number.isInteger(${r})`);
1715
};
1816

1917
for (let i = 0; i < n; ++i) {

test/src/randrange_only_stop.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import test from 'ava';
22
import {randrange} from '../../src/index.js';
33

4-
import type from '@aureooms/js-type';
5-
64
test('randrange only stop', (t) => {
75
let r;
86

@@ -12,7 +10,7 @@ test('randrange only stop', (t) => {
1210
const check = () => {
1311
t.true(r < rj, `${r} < ${rj}`);
1412
t.true(r >= 0, `${r} >= 0`);
15-
t.true(type.isint(r), `type.isint(${r})`);
13+
t.true(Number.isInteger(r), `Number.isInteger(${r})`);
1614
};
1715

1816
for (let i = 1; i < n; ++i) {

test/src/randrange_with_negative_step.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import test from 'ava';
22
import {randrange} from '../../src/index.js';
33

4-
import type from '@aureooms/js-type';
5-
64
test('randrange with negative step', (t) => {
75
let r;
86
let step;
@@ -15,7 +13,7 @@ test('randrange with negative step', (t) => {
1513
t.true(r <= rj, `${r} <= ${rj}`);
1614
t.true(r > ri, `${r} > ${ri}`);
1715
t.true((rj - r) % -step === 0, `(${rj} - ${r}) % (-${step}) === 0`);
18-
t.true(type.isint(r), `type.isint(${r})`);
16+
t.true(Number.isInteger(r), `Number.isInteger(${r})`);
1917
};
2018

2119
for (step = -3; step <= -1; ++step) {

test/src/randrange_with_positive_step.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import test from 'ava';
22
import {randrange} from '../../src/index.js';
33

4-
import type from '@aureooms/js-type';
5-
64
test('randrange with positive step', (t) => {
75
let r;
86
let step;
@@ -15,7 +13,7 @@ test('randrange with positive step', (t) => {
1513
t.true(r < rj, `${r} < ${rj}`);
1614
t.true(r >= ri, `${r} >= ${ri}`);
1715
t.true((r - ri) % step === 0, `(${r} - ${ri}) % ${step} === 0`);
18-
t.true(type.isint(r), `type.isint(${r})`);
16+
t.true(Number.isInteger(r), `Number.isInteger(${r})`);
1917
};
2018

2119
for (step = 1; step <= 3; ++step) {

test/src/randrange_without_step.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import test from 'ava';
22
import {randrange} from '../../src/index.js';
33

4-
import type from '@aureooms/js-type';
5-
64
test('randrange without step', (t) => {
75
let r;
86

@@ -13,7 +11,7 @@ test('randrange without step', (t) => {
1311
const check = () => {
1412
t.true(r < rj, `${r} < ${rj}`);
1513
t.true(r >= ri, `${r} >= ${ri}`);
16-
t.true(type.isint(r), `type.isint(${r})`);
14+
t.true(Number.isInteger(r), `Number.isInteger(${r})`);
1715
};
1816

1917
for (let i = 0; i < n; ++i) {

test/src/reservoir.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import test from 'ava';
2-
import {range} from '@aureooms/js-itertools';
3-
import {increasing} from '@aureooms/js-compare';
4-
import {RedBlackTree} from '@aureooms/js-red-black-tree';
2+
import {range} from '@iterable-iterator/range';
53
import {reservoir, _waterman, randint} from '../../src/index.js';
64

75
const macro = (t, _, reservoir, k, n) => {
86
const sample = reservoir(k, range(n));
9-
const source = RedBlackTree.from(increasing, range(n));
10-
// We cannot use a Set as it would smoosh input duplicates
7+
const source = new Set(range(n));
118

12-
console.debug({sample});
139
t.is(sample.length, k);
14-
for (const i of range(Math.min(k, n))) t.true(source.remove(sample[i]));
10+
for (const i of range(Math.min(k, n))) t.true(source.delete(sample[i]));
1511
for (const i of range(n, k)) t.true(sample[i] === undefined);
1612
};
1713

test/src/sample.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import test from 'ava';
22
import {sample, _fisheryates, randint} from '../../src/index.js';
33

4-
import {_calloc} from '@aureooms/js-memory';
5-
import {iota, copy} from '@aureooms/js-array';
6-
import {increasing} from '@aureooms/js-compare';
4+
import {range} from '@iterable-iterator/range';
5+
import {increasing} from '@total-order/primitive';
76

87
const macro = (t, type, _, sample, n, k, i, j) => {
9-
const calloc = _calloc(type);
8+
const a = type.from(range(n));
9+
const b = type.from(a);
1010

11-
const a = calloc(n);
12-
const b = calloc(n);
13-
14-
iota(a, 0, n, 0);
15-
16-
copy(a, 0, n, b, 0);
1711
sample(k, b, i, j);
1812

1913
for (let it = 0; it < i; ++it) {

0 commit comments

Comments
 (0)