@@ -107,7 +107,7 @@ export class HierarchicalNavigableSmallWorld {
107107 } else oldNode = { } as Node ;
108108 if ( vector ) {
109109 let entryPoint = entryPointId && this . indexStore . get ( entryPointId ) ;
110- if ( entryPoint === undefined ) {
110+ if ( entryPoint == null ) {
111111 const level = Math . floor ( - Math . log ( Math . random ( ) ) * this . mL ) ;
112112 const node = {
113113 vector,
@@ -305,7 +305,7 @@ export class HierarchicalNavigableSmallWorld {
305305 }
306306 function updateNode ( id : number , node ?: Node ) {
307307 // keep a record of all our changes, maintaining any changes that are queued to be written
308- let updatedNode : Node = updatedNodes . get ( id ) ! ;
308+ let updatedNode : Node = updatedNodes . get ( id ) ;
309309 if ( ! updatedNode && node ) {
310310 // copy the node so we can modify it
311311 updatedNode = { ...node } ;
@@ -363,7 +363,7 @@ export class HierarchicalNavigableSmallWorld {
363363 while ( candidates . length > 0 ) {
364364 // Get closest unvisited element
365365 candidates . sort ( ( a , b ) => a . distance - b . distance ) ;
366- const current = candidates . shift ( ) ! ;
366+ const current = candidates . shift ( ) ;
367367
368368 // Get least result distance
369369 const furthestDistance = results [ results . length - 1 ] . distance ;
0 commit comments