Skip to content

Commit ec1336c

Browse files
💥 refactor!: rename empty to isEmpty.
This required to upgrade @aureooms/js-fingertree to v6. Upgraded a bunch of other dependencies along with it. BREAKING CHANGE: This breaks any dependent relying on the old API.
1 parent 7d9b72f commit ec1336c

File tree

12 files changed

+554
-1046
lines changed

12 files changed

+554
-1046
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@
7777
},
7878
"dependencies": {},
7979
"devDependencies": {
80-
"@aureooms/js-fingertree": "5.0.2",
81-
"@aureooms/js-itertools": "5.0.1",
82-
"@aureooms/js-measure": "1.0.3",
83-
"@aureooms/js-predicate": "2.0.2",
80+
"@aureooms/js-fingertree": "6.0.0",
81+
"@aureooms/js-itertools": "5.1.0",
82+
"@aureooms/js-measure": "2.0.0",
83+
"@aureooms/js-predicate": "3.0.1",
8484
"@babel/cli": "7.13.10",
8585
"@babel/core": "7.13.10",
86-
"@babel/preset-env": "7.13.10",
86+
"@babel/preset-env": "7.13.12",
8787
"@babel/register": "7.13.8",
8888
"ava": "3.15.0",
8989
"babel-plugin-transform-remove-console": "6.9.4",

src/heap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let Heap = function ( tree ) {
55
this.tree = tree ;
66
} ;
77

8-
Heap.prototype.empty = function ( ) {
9-
return this.tree.empty( ) ;
8+
Heap.prototype.isEmpty = function ( ) {
9+
return this.tree.isEmpty( ) ;
1010
} ;
1111

1212
Heap.prototype.maxKey =

src/indordseq.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const IndOrdSeq = function ( tree ) {
99
this.tree = tree ;
1010
} ;
1111

12-
IndOrdSeq.prototype.empty = function ( ) {
13-
return this.tree.empty( ) ;
12+
IndOrdSeq.prototype.isEmpty = function ( ) {
13+
return this.tree.isEmpty( ) ;
1414
} ;
1515

1616
IndOrdSeq.prototype.measure = function ( ) {
@@ -72,7 +72,7 @@ IndOrdSeq.prototype.deleteAll = function ( value ) {
7272

7373
IndOrdSeq.prototype.merge = function ( other ) {
7474

75-
if ( other.empty( ) ) return this ;
75+
if ( other.isEmpty( ) ) return this ;
7676

7777
const a = other.head( ) ;
7878
const k = key.measure( a ) ;

src/intervaltree.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const matches = function* ( low , tree ) {
1313

1414
const xs = tree.dropUntil( ( m ) => atleast( low , m ) ) ;
1515

16-
if ( xs.empty( ) ) return ;
16+
if ( xs.isEmpty( ) ) return ;
1717

1818
yield xs.head( ) ;
1919

@@ -25,8 +25,8 @@ const IntervalTree = function ( tree ) {
2525
this.tree = tree ;
2626
} ;
2727

28-
IntervalTree.prototype.empty = function ( ) {
29-
return this.tree.empty( ) ;
28+
IntervalTree.prototype.isEmpty = function ( ) {
29+
return this.tree.isEmpty( ) ;
3030
} ;
3131

3232
IntervalTree.prototype.measure = function ( ) {
@@ -74,7 +74,7 @@ IntervalTree.prototype.insert = function ( interval ) {
7474

7575
IntervalTree.prototype.merge = function ( other ) {
7676

77-
if ( other.empty( ) ) return this ;
77+
if ( other.isEmpty( ) ) return this ;
7878

7979
const a = other.head( ) ;
8080
const k = M.measure( a )[0] ;

src/ordseq.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const OrdSeq = function ( tree ) {
99
this.tree = tree ;
1010
} ;
1111

12-
OrdSeq.prototype.empty = function ( ) {
13-
return this.tree.empty( ) ;
12+
OrdSeq.prototype.isEmpty = function ( ) {
13+
return this.tree.isEmpty( ) ;
1414
} ;
1515

1616
OrdSeq.prototype.measure = function ( ) {
@@ -72,7 +72,7 @@ OrdSeq.prototype.deleteAll = function ( value ) {
7272

7373
OrdSeq.prototype.merge = function ( other ) {
7474

75-
if ( other.empty( ) ) return this ;
75+
if ( other.isEmpty( ) ) return this ;
7676

7777
const a = other.head( ) ;
7878
const k = key.measure( a ) ;

src/seq.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const Seq = function ( tree ) {
55
this.tree = tree ;
66
} ;
77

8-
Seq.prototype.empty = function ( ) {
9-
return this.tree.empty( ) ;
8+
Seq.prototype.isEmpty = function ( ) {
9+
return this.tree.isEmpty( ) ;
1010
} ;
1111

1212
Seq.prototype.measure =

test/src/heap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test( 'heap' , t => {
2424
t.is( b , 2 ) ;
2525
t.is( c , 1 ) ;
2626

27-
t.true( z[1].empty( ) ) ;
27+
t.true( z[1].isEmpty( ) ) ;
2828
t.is( h.maxKey( ) , 3 ) ;
2929
t.is( x[1].maxKey( ) , 2 ) ;
3030
t.is( y[1].maxKey( ) , 1 ) ;
@@ -43,7 +43,7 @@ test( 'heap' , t => {
4343
t.is( b , 2 ) ;
4444
t.is( c , 1 ) ;
4545

46-
t.true( z[1].empty( ) ) ;
46+
t.true( z[1].isEmpty( ) ) ;
4747
t.is( h.maxKey( ) , 3 ) ;
4848
t.is( x[1].maxKey( ) , 2 ) ;
4949
t.is( y[1].maxKey( ) , 1 ) ;

test/src/indordseq.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ test( 'indordseq (ordseq behavior)' , t => {
1313

1414
let o = IndOrdSeq.empty( ) ;
1515

16-
t.true( o.empty( ) ) ;
16+
t.true( o.isEmpty( ) ) ;
1717

1818
o = o.insert( 1 ) ;
1919
o = o.insert( 3 ) ;
2020
o = o.insert( 2 ) ;
2121

2222
t.deepEqual( o.measure( ) , [ 3 , 3 ] ) ;
2323

24-
t.true( !o.empty( ) ) ;
24+
t.true( !o.isEmpty( ) ) ;
2525

2626
t.is( o.min( ) , 1 ) ;
2727
t.is( o.max( ) , 3 ) ;
@@ -51,15 +51,15 @@ test( 'indordseq (seq behavior)' , t => {
5151

5252
let s = IndOrdSeq.empty( ) ;
5353

54-
t.true( s.empty( ) ) ;
54+
t.true( s.isEmpty( ) ) ;
5555

5656
t.is( s.len( ) , 0 ) ;
5757

5858
s = s.insert( 'b' ) ;
5959
s = s.insert( 'c' ) ;
6060
s = s.insert( 'a' ) ;
6161

62-
t.true( !s.empty( ) ) ;
62+
t.true( !s.isEmpty( ) ) ;
6363

6464
t.is( s.len( ) , 3 ) ;
6565

test/src/intervaltree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test( 'intervaltree' , t => {
1111

1212
let i = IntervalTree.empty( ) ;
1313

14-
t.true( i.empty( ) ) ;
14+
t.true( i.isEmpty( ) ) ;
1515

1616
i = i.insert( [ 1 , 7 ] ) ;
1717
i = i.insert( [ 3 , 9 ] ) ;

test/src/ordseq.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ test( 'ordseq' , t => {
1212

1313
let o = OrdSeq.empty( ) ;
1414

15-
t.true( o.empty( ) ) ;
15+
t.true( o.isEmpty( ) ) ;
1616

1717
o = o.insert( 1 ) ;
1818
o = o.insert( 3 ) ;
1919
o = o.insert( 2 ) ;
2020

2121
t.is( o.measure( ) , 3 ) ;
2222

23-
t.true( !o.empty( ) ) ;
23+
t.true( !o.isEmpty( ) ) ;
2424

2525
t.is( o.min( ) , 1 ) ;
2626
t.is( o.max( ) , 3 ) ;

0 commit comments

Comments
 (0)