Skip to content

Commit

Permalink
⬆️ deps: Upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Oct 28, 2022
1 parent 6c32451 commit 20bf8a6
Show file tree
Hide file tree
Showing 79 changed files with 3,998 additions and 4,798 deletions.
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,32 @@
},
"dependencies": {},
"devDependencies": {
"@aureooms/js-algorithms": "^3.0.7",
"@aureooms/js-int32": "^3.0.0",
"@aureooms/js-random": "^2.0.0",
"@babel/core": "7.13.10",
"@babel/preset-env": "7.13.12",
"@babel/register": "7.13.8",
"@commitlint/cli": "12.0.1",
"@arithmetic-type/int32": "0.0.1",
"@babel/core": "7.19.6",
"@babel/preset-env": "7.19.4",
"@babel/register": "7.18.9",
"@commitlint/cli": "17.1.2",
"@js-library/commitlint-config": "0.0.4",
"@randomized/random": "4.1.0",
"ava": "^3.15.0",
"babel-plugin-transform-remove-console": "6.9.4",
"babel-plugin-unassert": "3.0.1",
"babel-plugin-unassert": "3.2.0",
"babel-preset-power-assert": "3.0.0",
"c8": "7.6.0",
"coveralls": "^3.1.0",
"c8": "7.12.0",
"coveralls": "^3.1.1",
"esdoc": "^1.1.0",
"esdoc-inject-script-plugin": "1.0.0",
"esdoc-inject-style-plugin": "1.0.0",
"esdoc-standard-plugin": "1.0.0",
"fixpack": "4.0.0",
"husky": "5.2.0",
"lint-staged": "10.5.4",
"microbundle": "0.13.0",
"np": "7.4.0",
"pinst": "2.1.6",
"husky": "8.0.1",
"lint-staged": "13.0.3",
"microbundle": "0.15.1",
"np": "7.6.2",
"pinst": "3.0.0",
"power-assert": "1.6.1",
"regenerator-runtime": "0.13.7",
"xo": "0.38.2"
"regenerator-runtime": "0.13.10",
"xo": "0.52.4"
},
"ava": {
"files": [
Expand Down Expand Up @@ -206,7 +205,8 @@
"unicorn/no-new-array": "off",
"prefer-exponentiation-operator": "off",
"no-return-assign": "off",
"no-negated-condition": "off"
"no-negated-condition": "off",
"no-bitwise": "off"
},
"overrides": [
{
Expand Down
10 changes: 10 additions & 0 deletions src/arithmetic/constants/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export * from './add1.js';
export * from './div2.js';
export * from './iadd1.js';
export * from './idiv2.js';
export * from './imul2.js';
export * from './imul5.js';
export * from './isub1.js';
export * from './mul2.js';
export * from './mul5.js';
export * from './sub1.js';
21 changes: 21 additions & 0 deletions src/arithmetic/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export * from './constants/index.js';
export * from './special/index.js';
export * from './add.js';
export * from './div.js';
export * from './divmod.js';
export * from './iadd.js';
export * from './idiv.js';
export * from './idivmod.js';
export * from './imod.js';
export * from './imul.js';
export * from './ishl.js';
export * from './ishr.js';
export * from './ishu.js';
export * from './isub.js';
export * from './mod.js';
export * from './mul.js';
export * from './neg.js';
export * from './shl.js';
export * from './shr.js';
export * from './shu.js';
export * from './sub.js';
1 change: 1 addition & 0 deletions src/arithmetic/special/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './div2n.js';
4 changes: 4 additions & 0 deletions src/compare/absapprox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const absapprox = (epsilon) => (a, b) => {
const r = a - b;
return r < -epsilon ? -1 : r > epsilon ? 1 : 0;
};
5 changes: 5 additions & 0 deletions src/compare/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './absapprox.js';
export * from './decreasing.js';
export * from './increasing.js';
export * from './relapprox.js';
export * from './sign.js';
13 changes: 13 additions & 0 deletions src/compare/relapprox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const relapprox = (epsilon) => (a, b) => {
if (b === 0) {
return a;
}

if (a === 0) {
return -b;
}

const r = a / b - 1;

return r < -epsilon ? -1 : r > epsilon ? 1 : 0;
};
5 changes: 5 additions & 0 deletions src/constants/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './$0.js';
export * from './$1.js';
export * from './$2.js';
export * from './$5.js';
export * from './$_1.js';
2 changes: 2 additions & 0 deletions src/exponential/constants/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './ipow2.js';
export * from './pow2.js';
4 changes: 4 additions & 0 deletions src/exponential/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './constants/index.js';
export * from './exp.js';
export * from './pow.js';
export * from './sqrt.js';
79 changes: 9 additions & 70 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,70 +1,9 @@
export {add1} from './arithmetic/constants/add1.js';
export {div2} from './arithmetic/constants/div2.js';
export {iadd1} from './arithmetic/constants/iadd1.js';
export {idiv2} from './arithmetic/constants/idiv2.js';
export {imul2} from './arithmetic/constants/imul2.js';
export {imul5} from './arithmetic/constants/imul5.js';
export {isub1} from './arithmetic/constants/isub1.js';
export {mul2} from './arithmetic/constants/mul2.js';
export {mul5} from './arithmetic/constants/mul5.js';
export {sub1} from './arithmetic/constants/sub1.js';
export {div2n} from './arithmetic/special/div2n.js';
export {add} from './arithmetic/add.js';
export {div} from './arithmetic/div.js';
export {divmod} from './arithmetic/divmod.js';
export {iadd} from './arithmetic/iadd.js';
export {idiv} from './arithmetic/idiv.js';
export {idivmod} from './arithmetic/idivmod.js';
export {imod} from './arithmetic/imod.js';
export {imul} from './arithmetic/imul.js';
export {ishl} from './arithmetic/ishl.js';
export {ishr} from './arithmetic/ishr.js';
export {ishu} from './arithmetic/ishu.js';
export {isub} from './arithmetic/isub.js';
export {mod} from './arithmetic/mod.js';
export {mul} from './arithmetic/mul.js';
export {neg} from './arithmetic/neg.js';
export {shl} from './arithmetic/shl.js';
export {shr} from './arithmetic/shr.js';
export {shu} from './arithmetic/shu.js';
export {sub} from './arithmetic/sub.js';
export {decreasing} from './compare/decreasing.js';
export {increasing} from './compare/increasing.js';
export {sign} from './compare/sign.js';
export {$0} from './constants/$0.js';
export {$1} from './constants/$1.js';
export {$2} from './constants/$2.js';
export {$5} from './constants/$5.js';
export {$_1} from './constants/$_1.js';
export {ipow2} from './exponential/constants/ipow2.js';
export {pow2} from './exponential/constants/pow2.js';
export {exp} from './exponential/exp.js';
export {pow} from './exponential/pow.js';
export {sqrt} from './exponential/sqrt.js';
export {parse} from './io/parse.js';
export {stringify} from './io/stringify.js';
export {log} from './logarithmic/log.js';
export {log2} from './logarithmic/log2.js';
export {loge} from './logarithmic/loge.js';
export {loglog} from './logarithmic/loglog.js';
export {loglog2} from './logarithmic/loglog2.js';
export {logloge} from './logarithmic/logloge.js';
export {copy} from './memory/copy.js';
export {eq0} from './predicate/constants/eq0.js';
export {eq1} from './predicate/constants/eq1.js';
export {eq_1} from './predicate/constants/eq_1.js';
export {ge1} from './predicate/constants/ge1.js';
export {gt0} from './predicate/constants/gt0.js';
export {gt1} from './predicate/constants/gt1.js';
export {le1} from './predicate/constants/le1.js';
export {lt1} from './predicate/constants/lt1.js';
export {eq} from './predicate/eq.js';
export {ge} from './predicate/ge.js';
export {gt} from './predicate/gt.js';
export {le} from './predicate/le.js';
export {lt} from './predicate/lt.js';
export {ne} from './predicate/ne.js';
export {PI} from './trigonometry/PI.js';
export {atan2} from './trigonometry/atan2.js';
export {cos} from './trigonometry/cos.js';
export {sin} from './trigonometry/sin.js';
export * from './arithmetic/index.js';
export * from './compare/index.js';
export * from './constants/index.js';
export * from './exponential/index.js';
export * from './io/index.js';
export * from './logarithmic/index.js';
export * from './memory/index.js';
export * from './predicate/index.js';
export * from './trigonometry/index.js';
2 changes: 2 additions & 0 deletions src/io/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './parse.js';
export * from './stringify.js';
3 changes: 2 additions & 1 deletion src/io/parse.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const parse = (n) => Number(n);
// eslint-disable-next-line unicorn/prefer-native-coercion-functions
export const parse = (x) => Number(x);
6 changes: 6 additions & 0 deletions src/logarithmic/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * from './log.js';
export * from './log2.js';
export * from './loge.js';
export * from './loglog.js';
export * from './loglog2.js';
export * from './logloge.js';
1 change: 1 addition & 0 deletions src/memory/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './copy.js';
1 change: 1 addition & 0 deletions src/predicate/constants/ge0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ge0 = (n) => n >= 0;
11 changes: 11 additions & 0 deletions src/predicate/constants/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export * from './eq0.js';
export * from './eq1.js';
export * from './eq_1.js';
export * from './ge0.js';
export * from './ge1.js';
export * from './gt0.js';
export * from './gt1.js';
export * from './le0.js';
export * from './le1.js';
export * from './lt0.js';
export * from './lt1.js';
1 change: 1 addition & 0 deletions src/predicate/constants/le0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const le0 = (n) => n <= 0;
1 change: 1 addition & 0 deletions src/predicate/constants/lt0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const lt0 = (n) => n < 0;
7 changes: 7 additions & 0 deletions src/predicate/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export * from './constants/index.js';
export * from './eq.js';
export * from './ge.js';
export * from './gt.js';
export * from './le.js';
export * from './lt.js';
export * from './ne.js';
4 changes: 4 additions & 0 deletions src/trigonometry/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './PI.js';
export * from './atan2.js';
export * from './cos.js';
export * from './sin.js';
16 changes: 16 additions & 0 deletions test/src/_fixtures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const macro = (t, expected, f, ...args) => {
t.is(f(...args), expected);
};

macro.title = (title, expected, f, ...args) =>
title ?? `${f.name}(${args.join(', ')}) is ${JSON.stringify(expected)}`;

const throws = (t, expected, f, ...args) => {
t.throws(() => f(...args), expected);
};

throws.title = (title, expected, f, ...args) => {
return (
title ?? `${f.name}(${args.join(', ')}) throws ${JSON.stringify(expected)}`
);
};
2 changes: 1 addition & 1 deletion test/src/arithmetic/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as number from '../../../src/index.js';

test('add', (t) => {
const one = function (a, b) {
t.is(number.add(a, b), a + b, a + ' + ' + b);
t.is(number.add(a, b), a + b);
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/add1.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as number from '../../../../src/index.js';

test('add1', (t) => {
const one = function (n) {
t.deepEqual(number.add1(n), n + 1, n + ' + ' + 1);
t.deepEqual(number.add1(n), n + 1);
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/div2.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as number from '../../../../src/index.js';

test('div2', (t) => {
const one = function (n) {
t.deepEqual(number.div2(n), n / 2, n + ' / ' + 2);
t.deepEqual(number.div2(n), n / 2);
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/iadd1.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('iadd1', (t) => {
const one = function (n) {
const x = n;

t.deepEqual(number.iadd1(x), (n += 1), x + ' += ' + 1);
t.deepEqual(number.iadd1(x), (n += 1));
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/idiv2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('idiv2', (t) => {
const one = function (n) {
const x = n;

t.deepEqual(number.idiv2(x), (n /= 2), x + ' /= ' + 2);
t.deepEqual(number.idiv2(x), (n /= 2));
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/imul2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('imul2', (t) => {
const one = function (a) {
const x = a;

t.deepEqual(number.imul2(x), (a *= 2), x + ' *= 2');
t.deepEqual(number.imul2(x), (a *= 2));
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/imul5.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('imul5', (t) => {
const one = function (a) {
const x = a;

t.deepEqual(number.imul5(x), (a *= 5), x + ' *= 5');
t.deepEqual(number.imul5(x), (a *= 5));
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/isub1.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('isub1', (t) => {
const one = function (n) {
const x = n;

t.deepEqual(number.isub1(x), (n -= 1), x + ' -= ' + 1);
t.deepEqual(number.isub1(x), (n -= 1));
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/mul2.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as number from '../../../../src/index.js';

test('mul2', (t) => {
const one = function (a) {
t.deepEqual(number.mul2(a), a * 2, a + ' * 2');
t.deepEqual(number.mul2(a), a * 2);
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/mul5.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as number from '../../../../src/index.js';

test('mul5', (t) => {
const one = function (a) {
t.deepEqual(number.mul5(a), a * 5, a + ' * 5');
t.deepEqual(number.mul5(a), a * 5, `${n} * 5`);
};

const n = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/src/arithmetic/constants/sub1.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as number from '../../../../src/index.js';

test('sub1', (t) => {
const one = function (n) {
t.deepEqual(number.sub1(n), n - 1, n + ' - ' + 1);
t.deepEqual(number.sub1(n), n - 1, `${n} - 1`);
};

const n = 10;
Expand Down
4 changes: 2 additions & 2 deletions test/src/arithmetic/div.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as number from '../../../src/index.js';

test('div', (t) => {
const one = function (a, b) {
t.deepEqual(number.div(a, b), a / b, a + ' / ' + b);
t.deepEqual(number.div(a, b), a / b);
};

const n = 10;
Expand All @@ -20,7 +20,7 @@ test('div', (t) => {
one(0, Number.NEGATIVE_INFINITY);

const nan = function (a, b) {
t.true(Number.isNaN(number.div(a, b)), a + ' / ' + b);
t.true(Number.isNaN(number.div(a, b)));
};

nan(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);
Expand Down
Loading

0 comments on commit 20bf8a6

Please sign in to comment.