@@ -3041,7 +3041,7 @@ function components(g) {
3041
3041
var cmpt ;
3042
3042
3043
3043
function dfs ( v ) {
3044
- if ( visited . hasOwnProperty ( v ) ) return ;
3044
+ if ( Object . hasOwn ( visited , v ) ) return ;
3045
3045
visited [ v ] = true ;
3046
3046
cmpt . push ( v ) ;
3047
3047
g . successors ( v ) . forEach ( dfs ) ;
@@ -3098,7 +3098,7 @@ function postOrderDfs(v, navigation, visited, acc) {
3098
3098
if ( curr [ 1 ] ) {
3099
3099
acc . push ( curr [ 0 ] ) ;
3100
3100
} else {
3101
- if ( ! visited . hasOwnProperty ( curr [ 0 ] ) ) {
3101
+ if ( ! Object . hasOwn ( visited , curr [ 0 ] ) ) {
3102
3102
visited [ curr [ 0 ] ] = true ;
3103
3103
stack . push ( [ curr [ 0 ] , true ] ) ;
3104
3104
forEachRight ( navigation ( curr [ 0 ] ) , w => stack . push ( [ w , false ] ) ) ;
@@ -3111,7 +3111,7 @@ function preOrderDfs(v, navigation, visited, acc) {
3111
3111
var stack = [ v ] ;
3112
3112
while ( stack . length > 0 ) {
3113
3113
var curr = stack . pop ( ) ;
3114
- if ( ! visited . hasOwnProperty ( curr ) ) {
3114
+ if ( ! Object . hasOwn ( visited , curr ) ) {
3115
3115
visited [ curr ] = true ;
3116
3116
acc . push ( curr ) ;
3117
3117
forEachRight ( navigation ( curr ) , w => stack . push ( w ) ) ;
@@ -3345,7 +3345,7 @@ function prim(g, weightFunc) {
3345
3345
var init = false ;
3346
3346
while ( pq . size ( ) > 0 ) {
3347
3347
v = pq . removeMin ( ) ;
3348
- if ( parents . hasOwnProperty ( v ) ) {
3348
+ if ( Object . hasOwn ( parents , v ) ) {
3349
3349
result . setEdge ( v , parents [ v ] ) ;
3350
3350
} else if ( init ) {
3351
3351
throw new Error ( "Input graph is not connected: " + g ) ;
@@ -3377,7 +3377,7 @@ function tarjan(g) {
3377
3377
stack . push ( v ) ;
3378
3378
3379
3379
g . successors ( v ) . forEach ( function ( w ) {
3380
- if ( ! visited . hasOwnProperty ( w ) ) {
3380
+ if ( ! Object . hasOwn ( visited , w ) ) {
3381
3381
dfs ( w ) ;
3382
3382
entry . lowlink = Math . min ( entry . lowlink , visited [ w ] . lowlink ) ;
3383
3383
} else if ( visited [ w ] . onStack ) {
@@ -3398,7 +3398,7 @@ function tarjan(g) {
3398
3398
}
3399
3399
3400
3400
g . nodes ( ) . forEach ( function ( v ) {
3401
- if ( ! visited . hasOwnProperty ( v ) ) {
3401
+ if ( ! Object . hasOwn ( visited , v ) ) {
3402
3402
dfs ( v ) ;
3403
3403
}
3404
3404
} ) ;
@@ -3413,11 +3413,11 @@ function topsort(g) {
3413
3413
var results = [ ] ;
3414
3414
3415
3415
function visit ( node ) {
3416
- if ( stack . hasOwnProperty ( node ) ) {
3416
+ if ( Object . hasOwn ( stack , node ) ) {
3417
3417
throw new CycleException ( ) ;
3418
3418
}
3419
3419
3420
- if ( ! visited . hasOwnProperty ( node ) ) {
3420
+ if ( ! Object . hasOwn ( visited , node ) ) {
3421
3421
stack [ node ] = true ;
3422
3422
visited [ node ] = true ;
3423
3423
g . predecessors ( node ) . forEach ( visit ) ;
@@ -3474,7 +3474,7 @@ class PriorityQueue {
3474
3474
* Returns `true` if **key** is in the queue and `false` if not.
3475
3475
*/
3476
3476
has ( key ) {
3477
- return this . _keyIndices . hasOwnProperty ( key ) ;
3477
+ return Object . hasOwn ( this . _keyIndices , key ) ;
3478
3478
}
3479
3479
3480
3480
/**
@@ -3512,7 +3512,7 @@ class PriorityQueue {
3512
3512
add ( key , priority ) {
3513
3513
var keyIndices = this . _keyIndices ;
3514
3514
key = String ( key ) ;
3515
- if ( ! keyIndices . hasOwnProperty ( key ) ) {
3515
+ if ( ! Object . hasOwn ( keyIndices , key ) ) {
3516
3516
var arr = this . _arr ;
3517
3517
var index = arr . length ;
3518
3518
keyIndices [ key ] = index ;
@@ -3660,9 +3660,9 @@ class Graph {
3660
3660
3661
3661
constructor ( opts ) {
3662
3662
if ( opts ) {
3663
- this . _isDirected = opts . hasOwnProperty ( "directed" ) ? opts . directed : true ;
3664
- this . _isMultigraph = opts . hasOwnProperty ( "multigraph" ) ? opts . multigraph : false ;
3665
- this . _isCompound = opts . hasOwnProperty ( "compound" ) ? opts . compound : false ;
3663
+ this . _isDirected = Object . hasOwn ( opts , "directed" ) ? opts . directed : true ;
3664
+ this . _isMultigraph = Object . hasOwn ( opts , "multigraph" ) ? opts . multigraph : false ;
3665
+ this . _isCompound = Object . hasOwn ( opts , "compound" ) ? opts . compound : false ;
3666
3666
}
3667
3667
3668
3668
if ( this . _isCompound ) {
@@ -3791,7 +3791,7 @@ class Graph {
3791
3791
* Complexity: O(1).
3792
3792
*/
3793
3793
setNode ( v , value ) {
3794
- if ( this . _nodes . hasOwnProperty ( v ) ) {
3794
+ if ( Object . hasOwn ( this . _nodes , v ) ) {
3795
3795
if ( arguments . length > 1 ) {
3796
3796
this . _nodes [ v ] = value ;
3797
3797
}
@@ -3824,7 +3824,7 @@ class Graph {
3824
3824
* Detects whether graph has a node with specified name or not.
3825
3825
*/
3826
3826
hasNode ( v ) {
3827
- return this . _nodes . hasOwnProperty ( v ) ;
3827
+ return Object . hasOwn ( this . _nodes , v ) ;
3828
3828
}
3829
3829
3830
3830
/**
@@ -3835,7 +3835,7 @@ class Graph {
3835
3835
*/
3836
3836
removeNode ( v ) {
3837
3837
var self = this ;
3838
- if ( this . _nodes . hasOwnProperty ( v ) ) {
3838
+ if ( Object . hasOwn ( this . _nodes , v ) ) {
3839
3839
var removeEdge = e => self . removeEdge ( self . _edgeObjs [ e ] ) ;
3840
3840
delete this . _nodes [ v ] ;
3841
3841
if ( this . _isCompound ) {
@@ -4113,7 +4113,7 @@ class Graph {
4113
4113
}
4114
4114
4115
4115
var e = edgeArgsToId ( this . _isDirected , v , w , name ) ;
4116
- if ( this . _edgeLabels . hasOwnProperty ( e ) ) {
4116
+ if ( Object . hasOwn ( this . _edgeLabels , e ) ) {
4117
4117
if ( valueSpecified ) {
4118
4118
this . _edgeLabels [ e ] = value ;
4119
4119
}
@@ -4178,7 +4178,7 @@ class Graph {
4178
4178
var e = ( arguments . length === 1
4179
4179
? edgeObjToId ( this . _isDirected , arguments [ 0 ] )
4180
4180
: edgeArgsToId ( this . _isDirected , v , w , name ) ) ;
4181
- return this . _edgeLabels . hasOwnProperty ( e ) ;
4181
+ return Object . hasOwn ( this . _edgeLabels , e ) ;
4182
4182
}
4183
4183
4184
4184
/**
@@ -4384,7 +4384,7 @@ function read(json) {
4384
4384
}
4385
4385
4386
4386
} , { "./graph" :44 } ] , 47 :[ function ( require , module , exports ) {
4387
- module . exports = '2.2.3 ' ;
4387
+ module . exports = '2.2.4 ' ;
4388
4388
4389
4389
} , { } ] } , { } , [ 1 ] ) ( 1 )
4390
4390
} ) ;
0 commit comments