data-structure-typed 1.53.3 → 1.53.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "data-structure-typed",
3
- "version": "1.53.3",
3
+ "version": "1.53.4",
4
4
  "description": "Javascript Data Structure. Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree(BST), AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack. Benchmark compared with C++ STL. API aligned with ES6 and Java.util. Usability is comparable to Python",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/mjs/index.js",
@@ -70,11 +70,11 @@
70
70
  "@typescript-eslint/eslint-plugin": "^8.12.1",
71
71
  "@typescript-eslint/parser": "^8.12.1",
72
72
  "auto-changelog": "^2.5.0",
73
- "avl-tree-typed": "^1.53.2",
73
+ "avl-tree-typed": "^1.53.3",
74
74
  "benchmark": "^2.1.4",
75
- "binary-tree-typed": "^1.53.2",
76
- "bst-typed": "^1.53.2",
77
- "data-structure-typed": "^1.53.2",
75
+ "binary-tree-typed": "^1.53.3",
76
+ "bst-typed": "^1.53.3",
77
+ "data-structure-typed": "^1.53.3",
78
78
  "dependency-cruiser": "^16.5.0",
79
79
  "doctoc": "^2.2.1",
80
80
  "eslint": "^9.13.0",
@@ -83,7 +83,7 @@
83
83
  "eslint-import-resolver-typescript": "^3.6.3",
84
84
  "eslint-plugin-import": "^2.31.0",
85
85
  "fast-glob": "^3.3.2",
86
- "heap-typed": "^1.53.2",
86
+ "heap-typed": "^1.53.3",
87
87
  "istanbul-badges-readme": "^1.9.0",
88
88
  "jest": "^29.7.0",
89
89
  "js-sdsl": "^4.4.2",
@@ -353,8 +353,8 @@ export class DoublyLinkedListNode<E = any> {
353
353
  * cache.set('c', 3);
354
354
  * cache.set('d', 4); // This will eliminate 'a'
355
355
  *
356
- * console.log(cache.get('a')).toBeUndefined();
357
- * expect(cache.get('b')); // 2
356
+ * console.log(cache.get('a')); // undefined
357
+ * console.log(cache.get('b')); // 2
358
358
  * console.log(cache.get('c')); // 3
359
359
  * console.log(cache.get('d')); // 4
360
360
  *
@@ -368,8 +368,8 @@ export class DoublyLinkedListNode<E = any> {
368
368
  * cache.set('d', 4); // This will eliminate 'b'
369
369
  *
370
370
  * console.log(cache.get('a')); // 1
371
- * console.log(cache.get('b')).toBeUndefined();
372
- * expect(cache.get('c')); // 3
371
+ * console.log(cache.get('b')); // undefined
372
+ * console.log(cache.get('c')); // 3
373
373
  * console.log(cache.get('d')); // 4
374
374
  *
375
375
  * // Should support updating existing keys
@@ -385,8 +385,8 @@ export class DoublyLinkedListNode<E = any> {
385
385
  * cache.set('b', 2);
386
386
  *
387
387
  * console.log(cache.delete('a')); // true
388
- * console.log(cache.get('a')).toBeUndefined();
389
- * expect(cache.size); // 1
388
+ * console.log(cache.get('a')); // undefined
389
+ * console.log(cache.size); // 1
390
390
  *
391
391
  * // Should support clearing cache
392
392
  * cache.clear();
@@ -431,11 +431,11 @@ export class DoublyLinkedListNode<E = any> {
431
431
  *
432
432
  * // 3. Find first lyric when timestamp is less than first entry
433
433
  * const earlyTimeLyric = lyricsList.findBackward(lyric => lyric.time <= -1000);
434
- * console.log(earlyTimeLyric).toBeUndefined();
434
+ * console.log(earlyTimeLyric); // undefined
435
435
  *
436
436
  * // 4. Find last lyric when timestamp is after last entry
437
437
  * const lateTimeLyric = lyricsList.findBackward(lyric => lyric.time <= 50000);
438
- * expect(lateTimeLyric?.text); // 'And I will try to fix you'
438
+ * console.log(lateTimeLyric?.text); // 'And I will try to fix you'
439
439
  * @example
440
440
  * // cpu process schedules
441
441
  * class Process {
package/testToExample.ts CHANGED
@@ -59,13 +59,6 @@ function extractExamplesFromFile(filePath: string): { name: string; body: string
59
59
  }
60
60
 
61
61
  const transformedBody = exampleBody
62
- .replace(
63
- /expect\((.*?)\)\.(toEqual|toBe|toStrictEqual|toHaveLength|toMatchObject)\((.*?)\);/gs, // Use `s` flag for multiline
64
- (match, actual, method, expected) => {
65
- expected = expected.replace(/\n/g, '\n //')
66
- return `console.log(${actual}); // ${expected}`;
67
- }
68
- )
69
62
  .replace(
70
63
  /expect\((.*?)\)\.(toBeUndefined|toBeNull)\(\);/g,
71
64
  (match, actual, method) => {
@@ -73,6 +66,13 @@ function extractExamplesFromFile(filePath: string): { name: string; body: string
73
66
  return `console.log(${actual}); // ${expectedValue}`;
74
67
  }
75
68
  )
69
+ .replace(
70
+ /expect\((.*?)\)\.(toEqual|toBe|toStrictEqual|toHaveLength|toMatchObject)\((.*?)\);/gs, // Use `s` flag for multiline
71
+ (match, actual, method, expected) => {
72
+ expected = expected.replace(/\n/g, '\n //')
73
+ return `console.log(${actual}); // ${expected}`;
74
+ }
75
+ )
76
76
  .trim();
77
77
 
78
78
  examples.push({ name: exampleName, body: transformedBody });