Skip to content

Commit 306e288

Browse files
🤖 refactor: Use ESM import syntax.
These changes were automatically generated by a transform whose code can be found at: - https://github.com/aureooms/rejuvenate/blob/67ba7d5e9b38c8944d42909a3a30b0710559b446/src/transforms/codemod:use-esm-import-syntax.js Please contact the author of the transform if you believe there was an error.
1 parent 115ae22 commit 306e288

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+83
-83
lines changed

src/DEFAULT_REPRESENTATION_BASE.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//import { DEFAULT_DISPLAY_BASE } from './' ;
2-
import { MAX_BASE } from './_limits' ;
2+
import { MAX_BASE } from "./_limits.js" ;
33

44
/*
55
* Biggest power of DEFAULT_DISPLAY_BASE whose square holds in a single double

src/Integer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { DEFAULT_DISPLAY_BASE , ZeroDivisionError } from './' ;
1+
import { DEFAULT_DISPLAY_BASE , ZeroDivisionError } from "./index.js" ;
22

33
import { ValueError } from '@aureooms/js-error' ;
44

5-
import { _from_number } from './_from_number' ;
5+
import { _from_number } from "./_from_number.js" ;
66

77
import {
88
stringify , convert , _trim_positive ,
@@ -13,7 +13,7 @@ import {
1313
euclidean_algorithm , extended_euclidean_algorithm ,
1414
} from '@aureooms/js-integer-big-endian' ;
1515

16-
import { MIN_NUMBER , MAX_NUMBER , MAX_BASE } from './_limits' ;
16+
import { MIN_NUMBER , MAX_NUMBER , MAX_BASE } from "./_limits.js" ;
1717

1818
export class Integer {
1919

src/IntegerRing.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Integer } from './' ;
2-
import { DEFAULT_DISPLAY_BASE } from './' ;
1+
import { Integer } from "./index.js" ;
2+
import { DEFAULT_DISPLAY_BASE } from "./index.js" ;
33
import { parse , convert } from '@aureooms/js-integer-big-endian' ;
44
import { TypeError , ValueError } from '@aureooms/js-error' ;
5-
import { _from_number } from './_from_number' ;
5+
import { _from_number } from "./_from_number.js" ;
66

77
export class IntegerRing {
88

src/ZZ.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
import {
33
DEFAULT_REPRESENTATION_BASE ,
44
IntegerRing ,
5-
} from './' ;
5+
} from "./index.js" ;
66

77
export const ZZ = new IntegerRing( 'Integer Ring' , DEFAULT_REPRESENTATION_BASE ) ;

src/_from_number.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Integer } from './Integer' ;
2-
import { MAX_BASE } from './_limits' ;
1+
import { Integer } from "./Integer.js" ;
2+
import { MAX_BASE } from "./_limits.js" ;
33

44
export function _from_number ( number ) {
55
const x = number >= 0 ? number : -number ;

src/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export * from './DEFAULT_DISPLAY_BASE' ;
2-
export * from './DEFAULT_REPRESENTATION_BASE' ;
3-
export * from './Integer' ;
4-
export * from './IntegerRing' ;
5-
export * from './ZZ' ;
6-
export * from './ZeroDivisionError' ;
7-
export * from './integer' ;
8-
export * from './_limits' ;
1+
export * from "./DEFAULT_DISPLAY_BASE.js" ;
2+
export * from "./DEFAULT_REPRESENTATION_BASE.js" ;
3+
export * from "./Integer.js" ;
4+
export * from "./IntegerRing.js" ;
5+
export * from "./ZZ.js" ;
6+
export * from "./ZeroDivisionError.js" ;
7+
export * from "./integer.js" ;
8+
export * from "./_limits.js" ;

src/integer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DEFAULT_DISPLAY_BASE , ZZ } from './' ;
1+
import { DEFAULT_DISPLAY_BASE , ZZ } from "./index.js" ;
22

33
export function $0 ( ) {
44
return ZZ.$0() ;

test/src/Integer/abs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { ZZ } from '../../../src' ;
2+
import { ZZ } from "../../../src/index.js" ;
33

44
function macro ( t , x ) {
55
t.is(x.toString().replace(/-/,''), ZZ.from(x).iabs().toString());

test/src/Integer/arithmetic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ , ZeroDivisionError } from '../../../src' ;
3+
import { ZZ , ZeroDivisionError } from "../../../src/index.js" ;
44

55
test( 'simple operations with 12 and 20' , t => {
66

test/src/Integer/clone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { ZZ } from '../../../src' ;
2+
import { ZZ } from "../../../src/index.js" ;
33

44
test ( 'Integer#copy' , t => {
55

test/src/Integer/compare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
test( 'compare' , t => {
66

test/src/Integer/digits.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
test( 'ZZ.from(3).pow(50).digits()' , t => {
66
t.deepEqual(

test/src/Integer/divide_knowing_divisible_by.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
function macro ( t , a , b , q ) {
66
const A = ZZ.from(a) ;

test/src/Integer/divides.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { ZZ , ZeroDivisionError } from '../../../src' ;
2+
import { ZZ , ZeroDivisionError } from "../../../src/index.js" ;
33

44
function macro ( t , a , b , expected ) {
55
t.is(expected, ZZ.from(a).divides(ZZ.from(b))) ;

test/src/Integer/divmod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ , ZeroDivisionError } from '../../../src' ;
3+
import { ZZ , ZeroDivisionError } from "../../../src/index.js" ;
44

55
function macro ( t , a , b , q , r ) {
66
const A = ZZ.from(a) ;

test/src/Integer/divround.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ , ZeroDivisionError } from '../../../src' ;
3+
import { ZZ , ZeroDivisionError } from "../../../src/index.js" ;
44

55
function macro ( t , a , b , expected ) {
66
t.is(expected.toString(), ZZ.from(a).divround(ZZ.from(b)).toString()) ;

test/src/Integer/egcd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
function macro ( t , a , b , expected ) {
66

test/src/Integer/gcd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
function macro ( t , a , b , c ) {
66
t.is( c.toString() , a.gcd(b).toString() ) ;

test/src/Integer/opposite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { ZZ } from '../../../src' ;
2+
import { ZZ } from "../../../src/index.js" ;
33

44
test( 'ZZ.$0().opposite()' , t => { t.is( ZZ.$0().opposite().toString() , '0' ) ; } ) ;
55
test( 'ZZ.$1().opposite()' , t => { t.is( ZZ.$1().opposite().toString() , '-1' ) ; } ) ;

test/src/Integer/parity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import test from 'ava' ;
22
import { range } from '@aureooms/js-itertools' ;
33

4-
import { ZZ } from '../../../src' ;
4+
import { ZZ } from "../../../src/index.js" ;
55

66
function even ( t , x ) {
77
t.true(x.iseven());

test/src/Integer/predicates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { ZZ } from '../../../src' ;
2+
import { ZZ } from "../../../src/index.js" ;
33

44

55
test( 'ZZ.$0().iszero()' , t => { t.is( ZZ.$0().iszero() , true ) ; } ) ;

test/src/Integer/sign.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { ZZ } from '../../../src' ;
2+
import { ZZ } from "../../../src/index.js" ;
33

44
test( 'ZZ.from(-2).sign()' , t => { t.is( ZZ.from(-2).sign() , -1 ) ; } ) ;
55
test( 'ZZ.from(-1).sign()' , t => { t.is( ZZ.from(-1).sign() , -1 ) ; } ) ;

test/src/Integer/square.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { ZZ } from '../../../src' ;
2+
import { ZZ } from "../../../src/index.js" ;
33

44
function number ( t , x ) {
55
t.is(x*x, ZZ.from(x).isquare().valueOf() ) ;

test/src/Integer/toNumber.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import test from 'ava' ;
33
import { randint } from '@aureooms/js-random' ;
44
import { ValueError } from '@aureooms/js-error' ;
55

6-
import { ZZ , MIN_NUMBER , MAX_NUMBER } from '../../../src' ;
6+
import { ZZ , MIN_NUMBER , MAX_NUMBER } from "../../../src/index.js" ;
77

88
function macro ( t , number ) {
99
const integer = ZZ.from(number) ;

test/src/Integer/toString.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
test( 'ZZ.from(3).pow(50).toString()' , t => { t.is(ZZ.from(3).pow(50).toString() , '717897987691852588770249' ) ; } ) ;
66
test( 'ZZ.from(3).pow(50).bin()' , t => {

test/src/IntegerRing/different_bases.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { IntegerRing } from '../../../src' ;
3+
import { IntegerRing } from "../../../src/index.js" ;
44

55
test( 'different bases' , t => {
66

test/src/ZZ/$0.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
test( '$0' , t => { t.is( ZZ.$0().toString(), '0' ) ; } ) ;
66
test( '$0.sign()' , t => { t.is( ZZ.$0().sign(), 0 ) ; } ) ;

test/src/ZZ/$1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
test( '$1' , t => { t.is( ZZ.$1().toString(), '1' ) ; } ) ;
66
test( '$1.sign()' , t => { t.is( ZZ.$1().sign(), 1 ) ; } ) ;

test/src/ZZ/$_1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
test( '$_1' , t => { t.is( ZZ.$_1().toString(), '-1' ) ; } ) ;
66
test( '$_1.sign()' , t => { t.is( ZZ.$_1().sign(), -1 ) ; } ) ;

test/src/ZZ/characteristic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import test from 'ava' ;
2-
import { ZZ } from '../../../src' ;
2+
import { ZZ } from "../../../src/index.js" ;
33

44
test( 'ZZ.characteristic()' , t => { t.true( ZZ.characteristic().iszero() ) ; } ) ;

test/src/ZZ/from.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import test from 'ava' ;
22

3-
import { ValueError } from '../../../src';
4-
import { TypeError } from '../../../src';
5-
import { MIN_NUMBER , MAX_NUMBER } from '../../../src' ;
6-
import { ZZ } from '../../../src' ;
3+
import { ValueError } from "../../../src/index.js";
4+
import { TypeError } from "../../../src/index.js";
5+
import { MIN_NUMBER , MAX_NUMBER } from "../../../src/index.js" ;
6+
import { ZZ } from "../../../src/index.js" ;
77

88
test( 'ZZ.from()' , t => {
99

test/src/ZZ/has.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
const has = ( t , x ) => t.true( ZZ.has(x) ) ;
66
has.title = ( providedTitle , x ) => `ZZ contains ${x.toString()}.`

test/src/ZZ/minmax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { ZZ } from '../../../src' ;
3+
import { ZZ } from "../../../src/index.js" ;
44

55
test( 'minmax' , t => {
66

test/src/ZZ/toString.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import test from 'ava' ;
2-
import { ZZ } from '../../../src' ;
2+
import { ZZ } from "../../../src/index.js" ;
33

44
test( 'ZZ.toString()' , t => { t.is( ZZ.toString() , 'Integer Ring' ) ; } ) ;

test/src/constants/DEFAULT_REPRESENTATION_BASE.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import test from 'ava' ;
33
import {
44
DEFAULT_REPRESENTATION_BASE ,
55
MAX_BASE ,
6-
} from '../../../src' ;
6+
} from "../../../src/index.js" ;
77

88
test( 'DEFAULT_REPRESENTATION_BASE <= MAX_BASE' , t => { t.true(DEFAULT_REPRESENTATION_BASE <= MAX_BASE) }) ;

test/src/integer/arithmetic/add.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , add } from '../../../../src' ;
2+
import { parse , stringify , add } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/addn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , addn } from '../../../../src' ;
2+
import { parse , stringify , addn } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/div.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , div } from '../../../../src' ;
2+
import { parse , stringify , div } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/divmod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , divmod } from '../../../../src' ;
2+
import { parse , stringify , divmod } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/divmodn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , divmodn } from '../../../../src' ;
2+
import { parse , stringify , divmodn } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/divn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , divn } from '../../../../src' ;
2+
import { parse , stringify , divn } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/iadd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , iadd } from '../../../../src' ;
2+
import { parse , stringify , iadd } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/iaddn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , iaddn } from '../../../../src' ;
2+
import { parse , stringify , iaddn } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/idiv.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , idiv } from '../../../../src' ;
2+
import { parse , stringify , idiv } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/idivmod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , idivmod } from '../../../../src' ;
2+
import { parse , stringify , idivmod } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/idivmodn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , idivmodn } from '../../../../src' ;
2+
import { parse , stringify , idivmodn } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/idivn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , idivn } from '../../../../src' ;
2+
import { parse , stringify , idivn } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/imod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , imod } from '../../../../src' ;
2+
import { parse , stringify , imod } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

test/src/integer/arithmetic/imodn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava' ;
2-
import { parse , stringify , imodn } from '../../../../src' ;
2+
import { parse , stringify , imodn } from "../../../../src/index.js" ;
33

44
const fmt = x => x.length <= 40 ? x : x.slice(0,19) + '..' + x.slice(-19);
55

0 commit comments

Comments
 (0)