File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44Skip list data structure for JavaScript.
55See [ docs] ( https://data-structures-and-algorithms.github.io/skip-list/index.html ) .
66
7- > :warning : The code requires ` regeneratorRuntime ` to be defined, for instance by importing
7+ > :warning : Depending on your environment, the code may require
8+ > ` regeneratorRuntime ` to be defined, for instance by importing
89> [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
910
1011``` js
Original file line number Diff line number Diff line change 11# Usage
22
3- > :warning : The code requires ` regeneratorRuntime ` to be defined, for instance by importing
3+ > :warning : Depending on your environment, the code may require
4+ > ` regeneratorRuntime ` to be defined, for instance by importing
45> [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
56
67First, require the polyfill at the entry point of your application
78``` js
8- await import ( ' regenerator-runtime/runtime.js' );
9+ await import (' regenerator-runtime/runtime.js' );
910// or
10- import ' regenerator-runtime/runtime.js' ;
11+ import ' regenerator-runtime/runtime.js' ;
1112```
1213
1314Then, import the library where needed
1415``` js
15- const skiplist = await import ( ' @data-structure/skip-list' ) ;
16+ const { SkipList } = await import (' @data-structure/skip-list' ) ;
1617// or
17- import * as skiplist from ' @data-structure/skip-list' ;
18+ import { SkipList } from ' @data-structure/skip-list' ;
1819```
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ const domReady = function (callback) {
77 }
88} ;
99
10- domReady ( function ( ) {
10+ domReady ( ( ) => {
1111 const projectname = document . createElement ( 'a' ) ;
1212 projectname . classList . add ( 'project-name' ) ;
13- projectname . text = 'data-structure/skip-list' ;
13+ projectname . text = '@ data-structure/skip-list' ;
1414 projectname . href = './index.html' ;
1515
1616 const header = document . querySelector ( 'header' ) ;
@@ -25,7 +25,7 @@ domReady(function () {
2525 const input = document . querySelector ( '.search-input' ) ;
2626
2727 // Active search box when focus on searchBox.
28- input . addEventListener ( 'focus' , function ( ) {
28+ input . addEventListener ( 'focus' , ( ) => {
2929 searchBox . classList . add ( 'active' ) ;
3030 } ) ;
3131} ) ;
You can’t perform that action at this time.
0 commit comments