From 2d07c5e5af32b708ec00d5890616bdd487ac0ba3 Mon Sep 17 00:00:00 2001 From: Revone Date: Wed, 16 Aug 2023 22:44:38 +0800 Subject: [PATCH] update Typescript version to 4.9.5, DirectedGraph tests completed, Remedial measures have been taken in TypeScript versions 5.0 and above to enforce consistent access modifiers for getters and setters., annotation content has been enriched. --- README.md | 457 ++-- package-lock.json | 2229 +++++++++++++---- package.json | 4 +- src/data-structures/binary-tree/aa-tree.ts | 2 +- .../binary-tree/binary-tree.ts | 98 +- .../binary-tree/segment-tree.ts | 58 +- src/data-structures/graph/abstract-graph.ts | 75 +- src/data-structures/graph/directed-graph.ts | 19 +- src/data-structures/graph/undirected-graph.ts | 29 +- src/data-structures/hash/coordinate-map.ts | 14 +- src/data-structures/hash/coordinate-set.ts | 14 +- src/data-structures/heap/heap.ts | 31 + .../linked-list/doubly-linked-list.ts | 79 +- .../linked-list/singly-linked-list.ts | 648 +++-- .../priority-queue/priority-queue.ts | 17 +- src/data-structures/queue/deque.ts | 48 +- src/data-structures/types/abstract-graph.ts | 6 +- .../graph/directed-graph.test.ts | 439 +++- 18 files changed, 3111 insertions(+), 1156 deletions(-) diff --git a/README.md b/README.md index 996d62b..8324226 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,28 @@ yarn add data-structure-typed ```bash npm install data-structure-typed ``` -## Online examples -[Online Examples](https://data-structure-typed-examples.vercel.app) +## Live Examples + +[Live Examples](https://data-structure-typed-examples.vercel.app) + +Live Examples ## Examples Repository -[Example Repository](https://github.com/zrwusa/data-structure-typed-examples) +[Examples Repository](https://github.com/zrwusa/data-structure-typed-examples) -## api docs +Examples Repository + +## Data Structures + +Meticulously crafted to empower developers with a versatile set of essential data structures. Our library includes a +wide range of data structures: +Binary Tree, Binary Search Tree (BST), AVL Tree, Tree Multiset, Segment Tree, Binary Indexed Tree, Graph, Directed +Graph, Undirected Graph, Linked List, Singly Linked List, Doubly Linked List, Queue, Object Deque, Array Deque, Stack, +Hash, Coordinate Set, Coordinate Map, Heap, Priority Queue, Max Priority Queue, Min Priority Queue, Trie + +## API docs [//]: # ([api docs](https://data-structure-typed-docs.vercel.app/)) @@ -37,14 +50,16 @@ npm install data-structure-typed [//]: # (
  • LoopType
  • )
  • AVLTree
  • AVLTreeNode
  • -
  • AaTree
  • + +[//]: # (
  • AaTree
  • )
  • AbstractEdge
  • AbstractGraph
  • AbstractVertex
  • ArrayDeque
  • BST
  • BSTNode
  • -
  • BTree
  • + +[//]: # (
  • BTree
  • )
  • BinaryIndexedTree
  • BinaryTree
  • BinaryTreeNode
  • @@ -68,200 +83,287 @@ npm install data-structure-typed
  • ObjectDeque
  • PriorityQueue
  • Queue
  • -
  • RBTree
  • + +[//]: # (
  • RBTree
  • )
  • SegmentTree
  • SegmentTreeNode
  • SinglyLinkedList
  • SinglyLinkedListNode
  • -
  • SplayTree
  • + +[//]: # (
  • SplayTree
  • )
  • Stack
  • TreeMultiSet
  • Trie
  • TrieNode
  • -
  • TwoThreeTree
  • + +[//]: # (
  • TwoThreeTree
  • )
  • UndirectedEdge
  • UndirectedGraph
  • UndirectedVertex
  • Vector2D
  • -## data structures +## Complexities + +### performance of Big O -Meticulously crafted to empower developers with a versatile set of essential data structures. Our library includes a wide range of data structures: -Binary Tree, Binary Search Tree (BST), AVL Tree, Tree Multiset, Segment Tree, Binary Indexed Tree, Graph, Directed Graph, Undirected Graph, Linked List, Singly Linked List, Doubly Linked List, Queue, Object Deque, Array Deque, Stack, Hash, Coordinate Set, Coordinate Map, Heap, Priority Queue, Max Priority Queue, Min Priority Queue, Trie - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[//]: # ( ) - -[//]: # ( ) - -[//]: # ( ) - -[//]: # ( ) - -[//]: # ( ) - -[//]: # ( ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
    Data StructureDerivedBasic FeaturesAdditional Features
    Big O NotationTypeComputations for 10 elementsComputations for 100 elementsComputations for 1000 elements
    Binary TreeAVL Tree, Binary Search Tree, Tree Multisetput, has, get, remove, size, insertTo, insertMany, fill, getDepth, getHeight, getMinHeight, getPathToRoot, isBalanced getLeftMost, isBST, getSubTreeSizeAndCount, subTreeSum, subTreeAdd, BFS, DFS, DFSIterative, levelIterative, listLevels, getPredecessor, morris,
    AVL TreeAll the features inherited from Binary Tree, balanceFactor, updateHeight, balancePath, balanceLL, balanceLR, balanceRR, balanceRL
    Binary Search Tree (BST)All the features inherited from Binary Tree, lastKeyAll the features inherited from Binary Tree, lesserSum, allGreaterNodesAdd, balance, isAVLBalanced
    Tree MultisetAll the features inherited from Binary TreeAll the features inherited from Binary Tree
    Segment Treebuild, updateNode, querySumByRange
    Binary Indexed Treeupdate, getPrefixSum, getRangeSum, BinaryIndexedTree.lowBit
    GraphDirected Graph, Undirected GraphgetVertex, getVertexId, containsVertex, vertexSet, addVertex, removeVertex, removeAllVertices, containsEdge, setEdgeWeight, getAllPathsBetween, getPathSumWeight, getMinCostBetween, getMinPathBetween, dijkstra, dijkstraWithoutHeap, bellmanFord, floyd, tarjan
    Directed GraphAll the features inherited from Graph, getEdge, addEdge, removeEdgeBetween, removeEdge, removeAllEdges, incomingEdgesOf, outgoingEdgesOf, degreeOf, inDegreeOf, outDegreeOf, edgesOf, getEdgeSrc, getEdgeDest, getDestinations, edgeSet, getNeighbors, getEndsOfEdgeAll the features inherited from Graph, topologicalSort
    Undirected GraphAll the features inherited from Graph, getEdge, addEdge, removeEdgeBetween, removeEdge, degreeOf, edgesOf, edgeSet, getEdgesOf, getNeighbors, getEndsOfEdgeAll the features inherited from Graph
    Singly Linked Listlength, head, tail, size, get, getNode, findNodeIndex, findNode, find, findIndex, append, push, prepend, insertAt, removeNode, removeAt, insertBefore, sort, insertAfter, shift, pop, merge, clear, slice, reverse, forEach, map, filter, reduce, toArray, toString
    HashCoordinateSet, CoordinateMap
    CoordinateSethas, set, get, delete
    CoordinateMaphas, add, delete
    Heap
    Doubly Linked Listsize, offerFirst, offerLast, peekFirst, peekLast, pollFirst, pollLast, get, isEmpty, insert, remove,
    Matrix
    Priority QueueMax Priority Queue, Min Priority Queueoffer, peek, poll, leaf, isEmpty, clear, toArray, cloneisValid, sort, DFS
    Max Priority QueueAll the features inherited from Priority QueueAll the features inherited from Priority Queue
    Min Priority QueueAll the features inherited from Priority QueueAll the features inherited from Priority Queue
    QueueQueue, Dequeueoffer, poll, peek, peekLast, size, isEmpty, toArray, clear, clone, Queue.fromArray
    ObjectDequesize, offerFirst, offerLast, pollFirst, peekFirst, pollLast, peekLast, get, isEmpty
    ArrayDequeofferLast, pollLast, pollFirst, offerFirst, peekFirst, peekLast, get, set, insert, remove, isEmpty
    StackisEmpty, size, peek, push, pop, toArray, clear, clone, Stack.fromArray
    Trieput, has, remove, isAbsPrefix, isPrefix, getAll
    O(1)Constant111
    O(log N)Logarithmic369
    O(N)Linear101001000
    O(N log N)n log(n)306009000
    O(N^2)Quadratic100100001000000
    O(2^N)Exponential10241.26e+291.07e+301
    O(N!)Factorial36288009.3e+1574.02e+2567
    +### Data Structure Complexity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Data StructureAccessSearchInsertionDeletionComments
    Array1nnn
    Stacknn11
    Queuenn11
    Linked Listnn1n
    Hash Table-nnnIn case of perfect hash function costs would be O(1)
    Binary Search TreennnnIn case of balanced tree costs would be O(log(n))
    B-Treelog(n)log(n)log(n)log(n)
    Red-Black Treelog(n)log(n)log(n)log(n)
    AVL Treelog(n)log(n)log(n)log(n)
    Bloom Filter-11-False positives are possible while searching
    + +### Sorting Complexity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameBestAverageWorstMemoryStableComments
    Bubble sortnn2n21Yes
    Insertion sortnn2n21Yes
    Selection sortn2n2n21No
    Heap sortn log(n)n log(n)n log(n)1No
    Merge sortn log(n)n log(n)n log(n)nYes
    Quick sortn log(n)n log(n)n2log(n)NoQuicksort is usually done in-place with O(log(n)) stack space
    Shell sortn log(n)depends on gap sequencen (log(n))21No
    Counting sortn + rn + rn + rn + rYesr - biggest number in array
    Radix sortn * kn * kn * kn + kYesk - length of longest key
    ![complexities](src/assets/complexities-diff.jpg) @@ -272,7 +374,6 @@ Binary Tree, Binary Search Tree (BST), AVL Tree, Tree Multiset, Segment Tree, Bi ![](src/data-structures/binary-tree/diagrams/avl-tree-inserting.gif) - ![](src/data-structures/graph/diagrams/tarjan.webp) ![](src/data-structures/graph/diagrams/adjacency-list.jpg) diff --git a/package-lock.json b/package-lock.json index 72cc7b1..c3ed1c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "data-structure-typed", - "version": "0.9.16", + "version": "1.12.21", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "data-structure-typed", - "version": "0.9.16", - "license": "ISC", + "version": "1.12.21", + "license": "MIT", "dependencies": { "lodash": "^4.17.21" }, @@ -19,7 +19,7 @@ "jest": "^29.6.2", "ts-jest": "^29.1.1", "typedoc": "^0.24.8", - "typescript": "^4.6.2" + "typescript": "^4.9.5" } }, "node_modules/@ampproject/remapping": { @@ -74,21 +74,6 @@ "node": ">=4" } }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -164,6 +149,15 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/generator": { "version": "7.22.10", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.10.tgz", @@ -195,6 +189,15 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", @@ -374,21 +377,6 @@ "node": ">=4" } }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -680,85 +668,6 @@ "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -801,6 +710,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/@jest/console/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/console/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/@jest/core": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.2.tgz", @@ -848,6 +806,76 @@ } } }, + "node_modules/@jest/core/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/core/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@jest/core/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@jest/environment": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.2.tgz", @@ -963,6 +991,118 @@ } } }, + "node_modules/@jest/reporters/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/reporters/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@jest/reporters/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/reporters/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@jest/reporters/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@jest/reporters/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@jest/reporters/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@jest/schemas": { "version": "29.6.0", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz", @@ -1045,6 +1185,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/@jest/transform/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/transform/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/@jest/types": { "version": "29.6.1", "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.1.tgz", @@ -1062,6 +1251,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/types/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -1235,9 +1473,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.4.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.9.tgz", - "integrity": "sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ==", + "version": "20.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.0.tgz", + "integrity": "sha512-Mgq7eCtoTjT89FqNoTzzXg2XvCi5VMhRV6+I2aYanc6kQCBImeNaAYRs/DyoVqk1YEUJK5gN9VO7HRIdz4Wo3Q==", "dev": true }, "node_modules/@types/stack-utils": { @@ -1341,12 +1579,15 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-sequence-parser": { @@ -1356,15 +1597,12 @@ "dev": true }, "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" @@ -1413,6 +1651,55 @@ "@babel/core": "^7.8.0" } }, + "node_modules/babel-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/babel-jest/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -1490,13 +1777,12 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -1589,9 +1875,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001519", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001519.tgz", - "integrity": "sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg==", + "version": "1.0.30001520", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001520.tgz", + "integrity": "sha512-tahF5O9EiiTzwTUqAeFjIZbn4Dnqxzz7ktrgGlMYNLH43Ul26IgTMH/zvL3DG0lZxBYnlT04axvInszUsZULdA==", "dev": true, "funding": [ { @@ -1609,16 +1895,12 @@ ] }, "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, "engines": { - "node": ">=10" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" @@ -1668,6 +1950,97 @@ "node": ">=12" } }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -1685,21 +2058,18 @@ "dev": true }, "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "color-name": "1.1.3" } }, "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/commander": { @@ -1778,9 +2148,9 @@ } }, "node_modules/dependency-cruiser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/dependency-cruiser/-/dependency-cruiser-13.1.2.tgz", - "integrity": "sha512-TKjNEvQF1snOi6f/5WwhkB7thhP9SJXaGOEs2mjv0BIqc5o1tvPvqID/sAPzUncptNI9MwjrqwpJHJ86/td1Hw==", + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/dependency-cruiser/-/dependency-cruiser-13.1.3.tgz", + "integrity": "sha512-bZS4XLBbbzGvP24Zl3KteiIDVuNff0RCvIN8qT9hNwfZOk2rO5dQVpR3a3nUSc8EDhbAH6oWeNZO/AJSLaO1jw==", "dev": true, "dependencies": { "acorn": "8.10.0", @@ -1823,176 +2193,6 @@ "node": "^16.14||>=18" } }, - "node_modules/dependency-cruiser/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/dependency-cruiser/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/dependency-cruiser/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/dependency-cruiser/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/dependency-cruiser/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/dependency-cruiser/node_modules/glob": { - "version": "10.3.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", - "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", - "dev": true, - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" - }, - "bin": { - "glob": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/dependency-cruiser/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/dependency-cruiser/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/dependency-cruiser/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/dependency-cruiser/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dependency-cruiser/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/dependency-cruiser/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/dependency-cruiser/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -2018,9 +2218,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.490", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.490.tgz", - "integrity": "sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A==", + "version": "1.4.492", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.492.tgz", + "integrity": "sha512-36K9b/6skMVwAIEsC7GiQ8I8N3soCALVSHqWHzNDtGemAcI9Xu8hP02cywWM0A794rTHm0b0zHPeLJHtgFVamQ==", "dev": true }, "node_modules/emittery": { @@ -2036,9 +2236,9 @@ } }, "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "node_modules/enhanced-resolve": { @@ -2073,12 +2273,15 @@ } }, "node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/esprima": { @@ -2117,6 +2320,12 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", @@ -2180,18 +2389,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/figures/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -2233,18 +2430,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2311,20 +2496,22 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "10.3.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", + "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2625,6 +2812,15 @@ "node": ">=8" } }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/istanbul-lib-report": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", @@ -2754,6 +2950,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-circus/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-circus/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-cli": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.2.tgz", @@ -2788,6 +3033,55 @@ } } }, + "node_modules/jest-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-cli/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-config": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.2.tgz", @@ -2833,6 +3127,97 @@ } } }, + "node_modules/jest-config/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/jest-config/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-config/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-config/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-config/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/jest-diff": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.2.tgz", @@ -2848,6 +3233,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-diff/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-docblock": { "version": "29.4.3", "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz", @@ -2876,6 +3310,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-each/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-each/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-environment-node": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.2.tgz", @@ -2955,6 +3438,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-message-util": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.2.tgz", @@ -2975,6 +3507,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-message-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-message-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-mock": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.2.tgz", @@ -3048,6 +3629,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-resolve/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-resolve/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-runner": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.2.tgz", @@ -3080,6 +3710,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-runner/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runner/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-runtime": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.2.tgz", @@ -3113,6 +3792,97 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-runtime/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/jest-runtime/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runtime/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-runtime/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-runtime/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/jest-snapshot": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.2.tgz", @@ -3144,37 +3914,53 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-snapshot/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/jest-snapshot/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "yallist": "^4.0.0" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "node_modules/jest-snapshot/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "color-name": "~1.1.4" }, "engines": { - "node": ">=10" + "node": ">=7.0.0" } }, - "node_modules/jest-snapshot/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "node_modules/jest-snapshot/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/jest-util": { @@ -3194,6 +3980,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-validate": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.2.tgz", @@ -3211,6 +4046,21 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-validate/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/jest-validate/node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -3223,6 +4073,40 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/jest-validate/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-validate/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-validate/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-watcher": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.2.tgz", @@ -3242,6 +4126,55 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-watcher/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-watcher/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/jest-worker": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.2.tgz", @@ -3410,39 +4343,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -3499,15 +4399,18 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -3520,9 +4423,9 @@ } }, "node_modules/minipass": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.2.tgz", - "integrity": "sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", + "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" @@ -3783,18 +4686,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -3935,39 +4826,6 @@ } }, "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/semver-try-require": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/semver-try-require/-/semver-try-require-6.2.3.tgz", - "integrity": "sha512-6q1N/Vr/4/G0EcQ1k4svN5kwfh3MJs4Gfl+zBAVcKn+AeIjKLwTXQ143Y6YHu6xEeN5gSCbCD1/5+NwCipLY5A==", - "dev": true, - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": "^14||^16||>=18" - } - }, - "node_modules/semver-try-require/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver-try-require/node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", @@ -3982,7 +4840,31 @@ "node": ">=10" } }, - "node_modules/semver-try-require/node_modules/yallist": { + "node_modules/semver-try-require": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/semver-try-require/-/semver-try-require-6.2.3.tgz", + "integrity": "sha512-6q1N/Vr/4/G0EcQ1k4svN5kwfh3MJs4Gfl+zBAVcKn+AeIjKLwTXQ143Y6YHu6xEeN5gSCbCD1/5+NwCipLY5A==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": "^14||^16||>=18" + } + }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", @@ -4022,10 +4904,16 @@ } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/sisteransi": { "version": "1.0.5", @@ -4079,6 +4967,15 @@ "node": ">=10" } }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -4092,20 +4989,44 @@ "node": ">=10" } }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/string-length/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-length/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", @@ -4121,7 +5042,22 @@ "node": ">=8" } }, - "node_modules/strip-ansi": { + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -4133,6 +5069,21 @@ "node": ">=8" } }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", @@ -4146,6 +5097,15 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -4229,6 +5189,48 @@ "node": ">=8" } }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -4299,39 +5301,6 @@ } } }, - "node_modules/ts-jest/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ts-jest/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ts-jest/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/tsconfig-paths": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", @@ -4360,6 +5329,55 @@ "node": ">=10.13.0" } }, + "node_modules/tsconfig-paths-webpack-plugin/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/tsconfig-paths-webpack-plugin/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/tsconfig-paths-webpack-plugin/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/tsconfig-paths-webpack-plugin/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -4411,30 +5429,6 @@ "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x" } }, - "node_modules/typedoc/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -4575,17 +5569,17 @@ "dev": true }, "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -4609,6 +5603,92 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4628,6 +5708,12 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -4670,6 +5756,47 @@ "node": ">=12" } }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 8aead64..57c21c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "data-structure-typed", - "version": "1.12.11", + "version": "1.12.21", "description": "Explore our comprehensive Javascript Data Structure / TypeScript Data Structure Library, meticulously crafted to empower developers with a versatile set of essential data structures. Our library includes a wide range of data structures, such as Binary Tree, AVL Tree, Binary Search Tree (BST), Tree Multiset, Segment Tree, Binary Indexed Tree, Graph, Directed Graph, Undirected Graph, Singly Linked List, Hash, CoordinateSet, CoordinateMap, Heap, Doubly Linked List, Priority Queue, Max Priority Queue, Min Priority Queue, Queue, ObjectDeque, ArrayDeque, Stack, and Trie. Each data structure is thoughtfully designed and implemented using TypeScript to provide efficient, reliable, and easy-to-use solutions for your programming needs. Whether you're optimizing algorithms, managing data, or enhancing performance, our TypeScript Data Structure Library is your go-to resource. Elevate your coding experience with these fundamental building blocks for software development.", "main": "dist/index.js", "scripts": { @@ -54,7 +54,7 @@ "jest": "^29.6.2", "ts-jest": "^29.1.1", "typedoc": "^0.24.8", - "typescript": "^4.6.2" + "typescript": "^4.9.5" }, "dependencies": { "lodash": "^4.17.21" diff --git a/src/data-structures/binary-tree/aa-tree.ts b/src/data-structures/binary-tree/aa-tree.ts index e46bdd9..3032e5d 100644 --- a/src/data-structures/binary-tree/aa-tree.ts +++ b/src/data-structures/binary-tree/aa-tree.ts @@ -1,3 +1,3 @@ export class AaTree { -} +} \ No newline at end of file diff --git a/src/data-structures/binary-tree/binary-tree.ts b/src/data-structures/binary-tree/binary-tree.ts index 29e47bd..dba3d8f 100644 --- a/src/data-structures/binary-tree/binary-tree.ts +++ b/src/data-structures/binary-tree/binary-tree.ts @@ -30,15 +30,15 @@ export enum LoopType { iterative = 1, recursive = 2} export class BinaryTreeNode { - constructor(id: BinaryTreeNodeId, val: T, count?: number) { - this._id = id; - this._val = val; - this._count = count ?? 1; + protected _id: BinaryTreeNodeId; + get id(): BinaryTreeNodeId { + return this._id; } - protected _id: BinaryTreeNodeId; - - get id(): BinaryTreeNodeId { + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getId(): BinaryTreeNodeId { return this._id; } @@ -47,21 +47,33 @@ export class BinaryTreeNode { } protected _val: T; - get val(): T { return this._val; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getVal(): T { + return this._val; + } + set val(v: T) { this._val = v; } protected _left?: BinaryTreeNode | null; - get left(): BinaryTreeNode | null | undefined { return this._left; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getLeft(): BinaryTreeNode | null | undefined { + return this._left; + } + set left(v: BinaryTreeNode | null | undefined) { if (v) { v.parent = this; @@ -71,11 +83,17 @@ export class BinaryTreeNode { } protected _right?: BinaryTreeNode | null; - get right(): BinaryTreeNode | null | undefined { return this._right; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getRight(): BinaryTreeNode | null | undefined { + return this._right; + } + set right(v: BinaryTreeNode | null | undefined) { if (v) { v.parent = this; @@ -85,45 +103,75 @@ export class BinaryTreeNode { } protected _parent: BinaryTreeNode | null | undefined; - get parent(): BinaryTreeNode | null | undefined { return this._parent; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getParent(): BinaryTreeNode | null | undefined { + return this._parent; + } + set parent(v: BinaryTreeNode | null | undefined) { this._parent = v; } protected _familyPosition: FamilyPosition = FamilyPosition.root; - get familyPosition(): FamilyPosition { return this._familyPosition; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getFamilyPosition(): FamilyPosition { + return this._familyPosition; + } + set familyPosition(v: FamilyPosition) { this._familyPosition = v; } protected _count = 1; - get count(): number { return this._count; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getCount(): number { + return this._count; + } + set count(v: number) { this._count = v; } protected _height = 0; - get height(): number { return this._height; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getHeight(): number { + return this._height; + } + set height(v: number) { this._height = v; } + constructor(id: BinaryTreeNodeId, val: T, count?: number) { + this._id = id; + this._val = val; + this._count = count ?? 1; + } + swapLocation(swapNode: BinaryTreeNode): BinaryTreeNode { const {val, count, height} = swapNode; const tempNode = new BinaryTreeNode(swapNode.id, val); @@ -187,6 +235,14 @@ export class BinaryTree { return this._root; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Getters (using the same name as the property) while utilizing separate method names for Setters. + * @returns The method is returning either a BinaryTreeNode object of type T or null. + */ + getRoot(): BinaryTreeNode | null { + return this._root; + } + protected set root(v: BinaryTreeNode | null) { if (v) { v.parent = null; @@ -201,6 +257,13 @@ export class BinaryTree { return this._size; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getSize(): number { + return this._size; + } + protected set size(v: number) { this._size = v; } @@ -211,6 +274,13 @@ export class BinaryTree { return this._count; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getCount(): number { + return this._count; + } + protected set count(v: number) { this._count = v; } diff --git a/src/data-structures/binary-tree/segment-tree.ts b/src/data-structures/binary-tree/segment-tree.ts index e028c3a..83d9afc 100644 --- a/src/data-structures/binary-tree/segment-tree.ts +++ b/src/data-structures/binary-tree/segment-tree.ts @@ -17,61 +17,85 @@ export class SegmentTreeNode { } protected _start = 0; - get start(): number { return this._start; } - + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getStart(): number { + return this._start; + } set start(v: number) { this._start = v; } protected _end = 0; - get end(): number { return this._end; } - + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getEnd(): number { + return this._end; + } set end(v: number) { this._end = v; } protected _val: SegmentTreeNodeVal | null = null; - get val(): SegmentTreeNodeVal | null { return this._val; } - + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getVal(): SegmentTreeNodeVal | null { + return this._val; + } set val(v: SegmentTreeNodeVal | null) { this._val = v; } protected _sum = 0; - get sum(): number { return this._sum; } - + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getSum(): number { + return this._sum; + } set sum(v: number) { this._sum = v; } protected _left: SegmentTreeNode | null = null; - get left(): SegmentTreeNode | null { return this._left; } - + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getLeft(): SegmentTreeNode | null { + return this._left; + } set left(v: SegmentTreeNode | null) { this._left = v; } protected _right: SegmentTreeNode | null = null; - get right(): SegmentTreeNode | null { return this._right; } - + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getRight(): SegmentTreeNode | null { + return this._right; + } set right(v: SegmentTreeNode | null) { this._right = v; } @@ -101,10 +125,18 @@ export class SegmentTree { } protected _root: SegmentTreeNode | null; - get root(): SegmentTreeNode | null { return this._root; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getRoot(): SegmentTreeNode | null { + return this._root; + } + set root(v: SegmentTreeNode | null) { + this._root = v; + } /** * The function builds a segment tree by recursively dividing the given range into smaller segments and creating nodes diff --git a/src/data-structures/graph/abstract-graph.ts b/src/data-structures/graph/abstract-graph.ts index 92a4f41..59ac1b8 100644 --- a/src/data-structures/graph/abstract-graph.ts +++ b/src/data-structures/graph/abstract-graph.ts @@ -10,19 +10,25 @@ import {PriorityQueue} from '../priority-queue'; import type {DijkstraResult, IGraph, VertexId} from '../types'; export class AbstractVertex { - constructor(id: VertexId) { - this._id = id; - } - protected _id: VertexId; - - public get id(): VertexId { + get id(): VertexId { return this._id; } - public set id(v: VertexId) { + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getId(): VertexId { + return this._id; + } + + set id(v: VertexId) { this._id = v; } + + constructor(id: VertexId) { + this._id = id; + } } export abstract class AbstractEdge { @@ -41,21 +47,33 @@ export abstract class AbstractEdge { } private _weight: number; - get weight(): number { return this._weight; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getWeight(): number { + return this._weight; + } + set weight(v: number) { this._weight = v; } private _hashCode: string; - get hashCode(): string { return this._hashCode; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getHashCode(): string { + return this._hashCode; + } + set hashCode(v: string) { this._hashCode = v; } @@ -97,9 +115,9 @@ export abstract class AbstractGraph ext * graph, and `false` if either the source or destination vertices of the edge are not present in the graph. */ addEdge(edge: E): boolean { - if (!(this.containsVertex(edge.src) && this.containsVertex(edge.dest))) { + if (!(this.hasVertex(edge.src) && this.hasVertex(edge.dest))) { return false; } @@ -401,7 +410,7 @@ export class DirectedGraph ext * returns null. */ getEndsOfEdge(edge: E): [V, V] | null { - if (!this.containsEdge(edge.src, edge.dest)) { + if (!this.hasEdge(edge.src, edge.dest)) { return null; } const v1 = this.getVertex(edge.src); diff --git a/src/data-structures/graph/undirected-graph.ts b/src/data-structures/graph/undirected-graph.ts index 6fd0e82..430db58 100644 --- a/src/data-structures/graph/undirected-graph.ts +++ b/src/data-structures/graph/undirected-graph.ts @@ -35,21 +35,38 @@ export class UndirectedEdge extends AbstractEdge { } private _vertices: [VertexId, VertexId]; - - public get vertices() { + get vertices() { return this._vertices; } - - public set vertices(v: [VertexId, VertexId]) { + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getVertices() { + return this._vertices; + } + set vertices(v: [VertexId, VertexId]) { this._vertices = v; } } export class UndirectedGraph extends AbstractGraph { - protected _edges: Map = new Map(); + protected _edges: Map; + get edges(): Map { + return this._edges; + } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getEdges(): Map { + return this._edges; + } + protected set edges(v: Map) { + this._edges = v; + } constructor() { super(); + this._edges = new Map(); } /** @@ -223,7 +240,7 @@ export class UndirectedGraph extends Map { - private readonly _joint: string = '_'; + protected _joint: string = '_'; + get joint(): string { + return this._joint; + } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getJoint(): string { + return this._joint; + } + protected set joint(v: string) { + this._joint = v; + } constructor(joint?: string) { super(); diff --git a/src/data-structures/hash/coordinate-set.ts b/src/data-structures/hash/coordinate-set.ts index 8c1e3e6..9245ebd 100644 --- a/src/data-structures/hash/coordinate-set.ts +++ b/src/data-structures/hash/coordinate-set.ts @@ -6,7 +6,19 @@ * @license MIT License */ export class CoordinateSet extends Set { - private readonly _joint: string = '_'; + protected _joint: string = '_'; + get joint(): string { + return this._joint; + } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getJoint(): string { + return this._joint; + } + protected set joint(v: string) { + this._joint = v; + } constructor(joint?: string) { super(); diff --git a/src/data-structures/heap/heap.ts b/src/data-structures/heap/heap.ts index 4ba2af9..17a2c29 100644 --- a/src/data-structures/heap/heap.ts +++ b/src/data-structures/heap/heap.ts @@ -10,7 +10,32 @@ import type {HeapItem, HeapOptions} from '../types'; export abstract class Heap { protected abstract _pq: PriorityQueue>; + get pq() { + return this._pq; + } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getPq() { + return this._pq; + } + protected set pq(v: PriorityQueue>) { + this._pq = v; + } + protected _priorityCb: (element: T) => number; + get priorityCb() { + return this._priorityCb; + } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getPriorityCb() { + return this._priorityCb; + } + protected set priorityCb(v: (element: T) => number) { + this._priorityCb = v; + } /** * The function is a constructor for a class that initializes a priority callback function based on the @@ -36,6 +61,12 @@ export abstract class Heap { get size(): number { return this._pq.size; } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getSize(): number { + return this._pq.size; + } /** * The function checks if a priority queue is empty. diff --git a/src/data-structures/linked-list/doubly-linked-list.ts b/src/data-structures/linked-list/doubly-linked-list.ts index 6ba4d47..8da9a84 100644 --- a/src/data-structures/linked-list/doubly-linked-list.ts +++ b/src/data-structures/linked-list/doubly-linked-list.ts @@ -8,29 +8,86 @@ import type {DoublyLinkedListGetBy} from '../types'; export class DoublyLinkedListNode { - val: T; - next: DoublyLinkedListNode | null; - prev: DoublyLinkedListNode | null; + protected _val: T; + get val(): T { + return this._val; + } + set val(v: T) { + this._val = v; + } + + protected _next: DoublyLinkedListNode | null; + get next(): DoublyLinkedListNode | null { + return this._next; + } + set next(v: DoublyLinkedListNode | null) { + this._next = v; + } + + protected _prev: DoublyLinkedListNode | null; + get prev(): DoublyLinkedListNode | null { + return this._prev; + } + set prev(v: DoublyLinkedListNode | null) { + this._prev = v; + } constructor(nodeValue: T) { - this.val = nodeValue; - this.next = null; - this.prev = null; + this._val = nodeValue; + this._next = null; + this._prev = null; } } export class DoublyLinkedList { - private _first: DoublyLinkedListNode | null = null; - private _last: DoublyLinkedListNode | null = null; - private _size = 0; + protected _first: DoublyLinkedListNode | null; + get first(): DoublyLinkedListNode | null { + return this._first; + } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getFirst(): DoublyLinkedListNode | null { + return this._first; + } + protected set first(v: DoublyLinkedListNode | null) { + this._first = v; + } + + protected _last: DoublyLinkedListNode | null; + get last(): DoublyLinkedListNode | null { + return this._last; + } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getLast(): DoublyLinkedListNode | null { + return this._last; + } + protected set last(v: DoublyLinkedListNode | null) { + this._last = v; + } + + protected _size: number; get size(): number { return this._size; } - - set size(v: number) { + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getSize(): number { + return this._size; + } + protected set size(v: number) { this._size = v; } + constructor() { + this._first = null; + this._last = null; + this._size = 0; + } + /** * The function adds a new node with a given value to the beginning of a doubly linked list. * @param {T} val - The `val` parameter represents the value of the element that you want to add to the beginning of diff --git a/src/data-structures/linked-list/singly-linked-list.ts b/src/data-structures/linked-list/singly-linked-list.ts index 37bcd3f..b1ab03f 100644 --- a/src/data-structures/linked-list/singly-linked-list.ts +++ b/src/data-structures/linked-list/singly-linked-list.ts @@ -6,81 +6,88 @@ * @license MIT License */ -/** - * The class which represents one link or node in a linked list - * ```ts - * const node = new SinglyLinkedListNode(1, null, null, null); - * ``` - */ -export class SinglyLinkedListNode { - constructor( - /** Data stored on the node */ - public val: NodeData, - /** The previous node in the list */ - public prev: SinglyLinkedListNode | null, - /** The next link in the list */ - public next: SinglyLinkedListNode | null, - /** The list this node belongs to */ - public list: SinglyLinkedList | null, - ) { + +/* The SinglyLinkedListNode class represents a node in a singly linked list and provides methods for inserting, removing, +and accessing nodes. */ +export class SinglyLinkedListNode { + protected _val: NodeVal; + get val(): NodeVal { + return this._val; } - /** - * Alias to .val - * ```ts - * new LinkedList(1, 2, 3).head.value; // 1 - * ``` - */ - public get value() { - return this.val; + set val(value: NodeVal) { + this._val = value; } - /** - * Get the index of this node - * ```ts - * new LinkedList(1, 2, 3).head.index; // 0 - * ``` - */ - public get index() { + protected _prev: SinglyLinkedListNode | null; + get prev(): SinglyLinkedListNode | null { + return this._prev; + } + + set prev(value: SinglyLinkedListNode | null) { + this._prev = value; + } + + protected _next: SinglyLinkedListNode | null + get next(): SinglyLinkedListNode | null { + return this._next; + } + + set next(value: SinglyLinkedListNode | null) { + this._next = value; + } + + protected _list: SinglyLinkedList | null + get list(): SinglyLinkedList | null { + return this._list; + } + + set list(value: SinglyLinkedList | null) { + this._list = value; + } + + constructor(val: NodeVal, prev?: SinglyLinkedListNode | null, next?: SinglyLinkedListNode | null, list?: SinglyLinkedList | null) { + this._val = val; + this._prev = prev || null; + this._next = next || null; + this._list = list || null; + } + + get index() { if (!this.list) { return undefined; } - return this.list.findIndex((value) => value === this.value); + return this.list.findIndex((value) => value === this.val); } /** - * Insert a new node before this one - * ```ts - * new LinkedList(2, 3).head.insertBefore(1); // 1 <=> 2 <=> 3 - * ``` - * @param val Data to save in the node + * The `insertBefore` function inserts a new node with the given value before the current node in a singly linked list. + * @param {NodeVal} val - The parameter "val" is of type "NodeVal". It represents the value of the node that you want + * to insert before the current node. + * @returns The method is returning a SinglyLinkedList. */ - public insertBefore(val: NodeData): SinglyLinkedList { + insertBefore(val: NodeVal): SinglyLinkedList { return this.list !== null ? this.list.insertBefore(this, val) : new SinglyLinkedList(val, this.val); } /** - * Insert new val after this node - * ```ts - * new LinkedList(1, 2).tail.insertAfter(3); // 1 <=> 2 <=> 3 - * ``` - * @param val Data to be saved in the node + * The function inserts a new node with the given value after the current node in a singly linked list. + * @param {NodeVal} val - The parameter `val` is the value of the node that you want to insert after the current node. + * @returns The method is returning a SinglyLinkedList. */ - public insertAfter(val: NodeData): SinglyLinkedList { + insertAfter(val: NodeVal): SinglyLinkedList { return this.list !== null ? this.list.insertAfter(this, val) : new SinglyLinkedList(this.val, val); } /** - * Remove this node - * ```ts - * new LinkedList(1, 2, 3, 4).tail.remove(); // 1 <=> 2 <=> 3 - * ``` + * The `remove()` function removes a node from a singly linked list. + * @returns The remove() method is returning a SinglyLinkedListNode object. */ - public remove(): SinglyLinkedListNode { + remove(): SinglyLinkedListNode { if (this.list === null) { throw new ReferenceError('Node does not belong to any list'); } @@ -88,27 +95,42 @@ export class SinglyLinkedListNode { } } +export class SinglyLinkedList { -/** - * A doubly linked list - * ```ts - * const list = new LinkedList(1, 2, 3); - * const listFromArray = LinkedList.from([1, 2, 3]); - * ``` - */ -export class SinglyLinkedList { + protected _head: SinglyLinkedListNode | null; + get head(): SinglyLinkedListNode | null { + return this._head; + } + set head(value: SinglyLinkedListNode | null) { + this._head = value; + } - /** The head of the list, the first node */ - public head: SinglyLinkedListNode | null; - /** The tail of the list, the last node */ - public tail: SinglyLinkedListNode | null; - /** Internal size reference */ - private size: number; - constructor(...args: NodeData[]) { - this.head = null; - this.tail = null; - this.size = 0; + protected _tail: SinglyLinkedListNode | null; + get tail(): SinglyLinkedListNode | null { + return this._tail; + } + set tail(value: SinglyLinkedListNode | null) { + this._tail = value; + } + + protected _size: number; + get size(): number { + return this._size; + } + set size(value: number) { + this._size = value; + } + + /** + * The constructor initializes a linked list with the given arguments as nodes. + * @param {NodeVal[]} args - args is a rest parameter that allows the constructor to accept an arbitrary number of + * arguments of type NodeVal. + */ + constructor(...args: NodeVal[]) { + this._head = null; + this._tail = null; + this._size = 0; for (let i = 0; i < arguments.length; i++) { this.append(args[i]); @@ -116,49 +138,39 @@ export class SinglyLinkedList { } /** - * The length of the list + * The `from` function in TypeScript creates a new SinglyLinkedList instance from an iterable object. + * @param iterable - The `iterable` parameter is an object that can be iterated over, such as an array or a string. It + * contains a collection of elements of type `T`. + * @returns The method is returning a new instance of the SinglyLinkedList class. */ - public get length(): number { - return this.size; - } - - /** - * Convert any iterable to a new linked list - * ```javascript - * const array = [1, 2, 3]; - * const list = LinkedList.from(array); - * ``` - * @param iterable Any iterable datatype like Array or Map - */ - public static from(iterable: Iterable): SinglyLinkedList { + static from(iterable: Iterable): SinglyLinkedList { return new SinglyLinkedList(...iterable); } /** - * Get the node val at a specified index, zero based - * ```ts - * new LinkedList(1, 2, 3).get(0); // 1 - * ``` - * @param index to retrieve val at + * The `get` function returns the value of a node at a given index in a data structure. + * @param {number} index - The index parameter is a number that represents the position of the node in the data + * structure. + * @returns The method is returning the value of the node at the specified index if the node exists, otherwise it + * returns undefined. */ - public get(index: number): NodeData | undefined { + get(index: number): NodeVal | undefined { const node = this.getNode(index); return node !== undefined ? node.val : undefined; } /** - * Get the node at index, zero based - * ```ts - * new LinkedList(1, 2, 3).getNode(0); - * // { prev: null, val: 1, next: SinglyLinkedListNode } - * ``` + * The function `getNode` returns the node at a given index in a singly linked list. + * @param {number} index - The `index` parameter is a number that represents the position of the node we want to + * retrieve from the linked list. + * @returns a SinglyLinkedListNode object or undefined. */ - public getNode(index: number): SinglyLinkedListNode | undefined { - if (this.head === null || index < 0 || index >= this.length) { + getNode(index: number): SinglyLinkedListNode | undefined { + if (this.head === null || index < 0 || index >= this.size) { return undefined; } - const asc = index < this.length / 2; - const stopAt = asc ? index : this.length - index - 1; + const asc = index < this.size / 2; + const stopAt = asc ? index : this.size - index - 1; const nextNode = asc ? 'next' : 'prev'; let currentNode = asc ? this.head : this.tail; // TODO after no-non-null-assertion not ensure the logic @@ -171,26 +183,28 @@ export class SinglyLinkedList { } /** - * Return the first node and its index in the list that - * satisfies the testing function - * ```ts - * new LinkedList(1, 2, 3).findNodeIndex(val => val === 1); - * // { node: SinglyLinkedListNode, index: 0 } - * ``` - * @param f A function to be applied to the val of each node + * The function `findNodeIndex` searches for a node in a singly linked list that satisfies a given condition and + * returns its index and the node itself. + * @param callbackFn - The callbackFn parameter is a function that takes three arguments: data, index, and list. It is + * used to determine whether a node in the singly linked list matches a certain condition. The function should return a + * boolean value indicating whether the condition is met for the given node. + * @returns The function `findNodeIndex` returns an object with two properties: `node` and `index`. The `node` property + * contains the node that matches the condition specified in the `callbackFn` function, and the `index` property + * contains the index of that node in the linked list. If no node matches the condition, the function returns + * `undefined`. */ - public findNodeIndex(f: ( - data: NodeData, + findNodeIndex(callbackFn: ( + data: NodeVal, index: number, - list: SinglyLinkedList, + list: SinglyLinkedList, ) => boolean): ({ - node: SinglyLinkedListNode, + node: SinglyLinkedListNode, index: number, }) | undefined { let currentIndex = 0; let currentNode = this.head; while (currentNode) { - if (f(currentNode.val, currentIndex, this)) { + if (callbackFn(currentNode.val, currentIndex, this)) { return { index: currentIndex, node: currentNode, @@ -203,67 +217,56 @@ export class SinglyLinkedList { } /** - * Returns the first node in the list that - * satisfies the provided testing function. Otherwise undefined is returned. - * ```ts - * new LinkedList(1, 2, 3).findNode(val => val === 1); - * // { prev: null, val: 1, next: SinglyLinkedListNode } - * ``` - * @param f Function to test val against + * The findNode function searches for a node in a singly linked list based on a given callback function. + * @param callbackFn - A callback function that takes three parameters: data, index, and list. It returns a boolean + * value indicating whether the current node matches the desired criteria. + * @returns The function `findNode` returns a `SinglyLinkedListNode` if a node satisfying the condition + * specified by the `callbackFn` is found in the linked list. If no such node is found, it returns `undefined`. */ - public findNode(f: ( - data: NodeData, + findNode(callbackFn: ( + data: NodeVal, index: number, - list: SinglyLinkedList, - ) => boolean): SinglyLinkedListNode | undefined { - const nodeIndex = this.findNodeIndex(f); + list: SinglyLinkedList, + ) => boolean): SinglyLinkedListNode | undefined { + const nodeIndex = this.findNodeIndex(callbackFn); return nodeIndex !== undefined ? nodeIndex.node : undefined; } /** - * Returns the value of the first element in the list that - * satisfies the provided testing function. Otherwise undefined is returned. - * ```ts - * new LinkedList(1, 2, 3).find(val => val === 1); // 1 - * ``` - * @param f Function to test val against + * The `find` function in TypeScript searches for a node in a singly linked list based on a given callback function and + * returns the value of the found node. + * @param callbackFn - A callback function that takes three parameters: data, index, and list. It returns a boolean + * value indicating whether the condition is met for a particular node in the linked list. + * @returns The method `find` returns the `NodeVal` value of the first node in the linked list that satisfies the + * condition specified by the `callbackFn` function. If no node satisfies the condition, it returns `undefined`. */ - public find(f: ( - data: NodeData, + find(callbackFn: ( + data: NodeVal, index: number, - list: SinglyLinkedList, - ) => boolean): NodeData | undefined { - const nodeIndex = this.findNodeIndex(f); + list: SinglyLinkedList, + ) => boolean): NodeVal | undefined { + const nodeIndex = this.findNodeIndex(callbackFn); return nodeIndex !== undefined ? nodeIndex.node.val : undefined; } /** - * Returns the index of the first node in the list that - * satisfies the provided testing function. Ohterwise -1 is returned. - * ```ts - * new LinkedList(1, 2, 3).findIndex(val => val === 3); // 2 - * ``` - * @param f Function to test val against + * The findIndex function returns the index of the first node in a singly linked list that satisfies a given condition, + * or -1 if no such node is found. + * @param callbackFn - A callback function that takes three parameters: data, index, and list. It returns a boolean + * value indicating whether the condition is met for a particular node in the singly linked list. + * @returns The method `findIndex` returns a number. */ - public findIndex(f: ( - data: NodeData, + findIndex(callbackFn: ( + data: NodeVal, index: number, - list: SinglyLinkedList, + list: SinglyLinkedList, ) => boolean): number { - const nodeIndex = this.findNodeIndex(f); + const nodeIndex = this.findNodeIndex(callbackFn); return nodeIndex !== undefined ? nodeIndex.index : -1; } - /** - * Append one or any number of nodes to the end of the list. - * This modifies the list in place and returns the list itself - * to make this method chainable. - * ```ts - * new LinkedList(1).append(2).append(3, 4); // 1 <=> 2 <=> 3 <=> 4 - * ``` - * @param args Data to be stored in the node, takes any number of arguments - */ - public append(...args: NodeData[]): SinglyLinkedList { + /* The above code is a comment in TypeScript. It is using the triple hash symbol ( */ + append(...args: NodeVal[]): SinglyLinkedList { for (const val of args) { const node = new SinglyLinkedListNode(val, this.tail, null, this); if (this.head === null) { @@ -279,26 +282,23 @@ export class SinglyLinkedList { } /** - * Synonym for append - * ```ts - * new LinkedList(1).push(2).push(3, 4); // 1 <=> 2 <=> 3 <=> 4 - * ``` - * @param args Data to be stored, takes any number of arguments + * The push function appends multiple NodeVal objects to a data structure and returns the new size of the data + * structure. + * @param {NodeVal[]} args - args is a rest parameter of type NodeVal[]. It allows the function to accept any number + * of arguments of type NodeVal. + * @returns The size of the data structure after the nodes are appended. */ - public push(...args: NodeData[]): number { + push(...args: NodeVal[]): number { this.append(...args); - return this.length; + return this.size; } /** - * Prepend any number of val arguments to the list. The - * argument list is prepended as a block to reduce confusion: - * ```javascript - * new LinkedList(3, 4).prepend(0, 1, 2); // [0, 1, 2, 3, 4] - * ``` - * @param args Data to be stored in the node, accepts any number of arguments + * The `prepend` function adds new nodes to the beginning of a singly linked list. + * @param {NodeVal[]} args - An array of NodeVal objects. + * @returns The `prepend` method is returning the updated `SinglyLinkedList` object. */ - public prepend(...args: NodeData[]): SinglyLinkedList { + prepend(...args: NodeVal[]): SinglyLinkedList { const reverseArgs = Array.from(args).reverse(); for (const val of reverseArgs) { const node = new SinglyLinkedListNode(val, null, this.head, this); @@ -315,16 +315,14 @@ export class SinglyLinkedList { } /** - * Insert a new node at a given index position. If index is - * out of bounds, the node is appended, if index is negative - * or 0, it will be prepended. - * ```ts - * new LinkedList(1, 3).insertAt(1, 2); // 1 <=> 2 <=> 3 - * ``` - * @param index The index to insert the new node at - * @param val Data to be stored on the new node + * The `insertAt` function inserts a value at a specified index in a singly linked list. + * @param {number} index - The index parameter is a number that represents the position at which the new node should be + * inserted in the linked list. + * @param {NodeVal} val - The `val` parameter represents the value of the node that you want to insert into the linked + * list. + * @returns The method `insertAt` returns the updated `SinglyLinkedList` object. */ - public insertAt(index: number, val: NodeData): SinglyLinkedList { + insertAt(index: number, val: NodeVal): SinglyLinkedList { if (this.head === null) { return this.append(val); } @@ -343,15 +341,13 @@ export class SinglyLinkedList { } /** - * Remove the specified node from the list and return the removed - * node afterwards. - * ```ts - * const list = new LinkedList(1, 2, 3); - * list.removeNode(list.tail); // { prev: null, val: 3, next: null, list: null } - * ``` - * @param node The node to be removed + * The removeNode function removes a node from a singly linked list and updates the head, tail, and size properties + * accordingly. + * @param node - The `node` parameter is of type `SinglyLinkedListNode`, which represents a node in a singly + * linked list. + * @returns the removed node. */ - public removeNode(node: SinglyLinkedListNode): SinglyLinkedListNode { + removeNode(node: SinglyLinkedListNode): SinglyLinkedListNode { if (node.list !== this) { throw new ReferenceError('Node does not belong to this list'); } @@ -380,30 +376,29 @@ export class SinglyLinkedList { } /** - * Remove the node at the specified index - * ```ts - * new LinkedList(1, 2, 3).removeAt(2); // { prev: null, val: 3, next: null, list: null } - * ``` - * @param index Index at which to remove + * The `removeAt` function removes a node at a specified index from a singly linked list. + * @param {number} index - The index parameter is a number that represents the position of the node to be removed in + * the singly linked list. + * @returns The method `removeAt` returns a `SinglyLinkedListNode` if the node at the specified index is + * found and removed successfully. If the node is not found, it returns `undefined`. */ - public removeAt(index: number): SinglyLinkedListNode | undefined { + removeAt(index: number): SinglyLinkedListNode | undefined { const node = this.getNode(index); return node !== undefined ? this.removeNode(node) : undefined; } /** - * Insert a new node before the reference node - * ```ts - * const list = new LinkedList(1, 3); - * list.insertBefore(list.tail, 2); // 1 <=> 2 <=> 3 - * ``` - * @param referenceNode The node reference - * @param val Data to save in the node + * The `insertBefore` function inserts a new node with a given value before a specified reference node in a singly + * linked list. + * @param referenceNode - The referenceNode parameter is the node in the linked list before which the new node will be + * inserted. + * @param {NodeVal} val - The value of the new node that will be inserted before the reference node. + * @returns The method is returning the updated SinglyLinkedList object. */ - public insertBefore( - referenceNode: SinglyLinkedListNode, - val: NodeData, - ): SinglyLinkedList { + insertBefore( + referenceNode: SinglyLinkedListNode, + val: NodeVal, + ): SinglyLinkedList { const node = new SinglyLinkedListNode(val, referenceNode.prev, referenceNode, this); if (referenceNode.prev === null) { this.head = node; @@ -417,23 +412,24 @@ export class SinglyLinkedList { } /** - * Sorts the linked list using the provided compare function - * @param compare A function used to compare the val of two nodes. It should return - * a boolean. True will insert a before b, false will insert b before a. - * (a, b) => a < b or (1, 2) => 1 < 2 === true, 2 will be inserted after 1, - * the sort order will be ascending. + * The `sort` function uses the quicksort algorithm to sort the elements of a singly linked list based on a provided + * comparison function. + * @param start - The `start` parameter is the starting node of the sublist that needs to be sorted. + * @param end - The `end` parameter is a reference to the last node in the linked list. It is used as the pivot element + * for the quicksort algorithm. + * @returns The `sort` method is returning the sorted `SinglyLinkedList` object. */ - public sort(compare: (a: NodeData, b: NodeData) => boolean): SinglyLinkedList { + sort(compare: (a: NodeVal, b: NodeVal) => boolean): SinglyLinkedList { if (this.head === null || this.tail === null) { return this; } - if (this.length < 2) { + if (this.size < 2) { return this; } const quicksort = ( - start: SinglyLinkedListNode, - end: SinglyLinkedListNode, + start: SinglyLinkedListNode, + end: SinglyLinkedListNode, ) => { if (start === end) { return; @@ -476,18 +472,16 @@ export class SinglyLinkedList { } /** - * Insert a new node after this one - * ```ts - * const list = new LinkedList(2, 3); - * list.insertAfter(list.head, 1); // 1 <=> 2 <=> 3 - * ``` - * @param referenceNode The reference node - * @param val Data to be saved in the node + * The `insertAfter` function inserts a new node with a given value after a specified reference node in a singly linked + * list. + * @param referenceNode - The referenceNode parameter is the node after which the new node will be inserted. + * @param {NodeVal} val - The value of the new node that will be inserted after the reference node. + * @returns The `insertAfter` method is returning the updated `SinglyLinkedList` object. */ - public insertAfter( - referenceNode: SinglyLinkedListNode, - val: NodeData, - ): SinglyLinkedList { + insertAfter( + referenceNode: SinglyLinkedListNode, + val: NodeVal, + ): SinglyLinkedList { const node = new SinglyLinkedListNode(val, referenceNode, referenceNode.next, this); if (referenceNode.next === null) { this.tail = node; @@ -501,39 +495,27 @@ export class SinglyLinkedList { } /** - * Remove the first node from the list and return the val of the removed node - * or undefined - * ```ts - * new LinkedList(1, 2, 3).shift(); // 1 - * ``` + * The `shift()` function removes and returns the first element from a linked list. + * @returns The `shift()` method is returning a value of type `NodeVal` or `undefined`. */ - public shift(): NodeData | undefined { + shift(): NodeVal | undefined { return this.removeFromAnyEnd(this.head); } /** - * Remove the last node from the list and return the val of the removed node - * or undefined if the list was empty - * ```ts - * new LinkedList(1, 2, 3).pop(); // 3 - * ``` + * The `pop()` function removes and returns the last element from a linked list. + * @returns The `pop()` method is returning a value of type `NodeVal` or `undefined`. */ - public pop(): NodeData | undefined { + pop(): NodeVal | undefined { return this.removeFromAnyEnd(this.tail); } /** - * Merge the current list with another. Both lists will be - * equal after merging. - * ```ts - * const list = new LinkedList(1, 2); - * const otherList = new LinkedList(3); - * list.merge(otherList); - * (list === otherList); // true - * ``` - * @param list The list to be merged + * The merge function merges two singly linked lists by updating the next and prev pointers, as well as the head, tail, + * and size properties. + * @param list - The parameter "list" is a SinglyLinkedList object that contains nodes with data of type NodeVal. */ - public merge(list: SinglyLinkedList): void { + merge(list: SinglyLinkedList): void { if (this.tail !== null) { this.tail.next = list.head; } @@ -549,13 +531,10 @@ export class SinglyLinkedList { } /** - * Removes all nodes from a list - * - * ```ts - * list.clear(); - * ``` + * The clear() function resets the linked list by setting the head and tail to null and the size to 0. + * @returns The "this" object is being returned. */ - public clear() { + clear() { this.head = null; this.tail = null; this.size = 0; @@ -563,19 +542,16 @@ export class SinglyLinkedList { } /** - * The slice() method returns a shallow copy of a - * portion of a list into a new list object selected - * from start to end (end not included). - * The original list will not be modified. - * ```ts - * const list = new LinkedList(1, 2, 3, 4, 5); - * const newList = list.slice(0, 3); // 1 <=> 2 <=> 3 - * ``` - * @param start Start index - * @param end End index, optional + * The `slice` function returns a new SinglyLinkedList containing a portion of the original list, starting from the + * specified index and ending at the optional end index. + * @param {number} start - The `start` parameter is a number that represents the index at which to start slicing the + * linked list. + * @param {number} [end] - The `end` parameter is an optional number that specifies the index at which to end the + * slicing. If no value is provided for `end`, or if the provided value is less than the `start` index, the slicing + * will continue until the end of the list. + * @returns a new SinglyLinkedList containing the sliced elements from the original list. */ - // eslint-disable-next-line @typescript-eslint/ban-types - public slice(start: number, end?: number): SinglyLinkedList { + slice(start: number, end?: number): SinglyLinkedList { const list = new SinglyLinkedList(); let finish = end; @@ -583,10 +559,10 @@ export class SinglyLinkedList { return list; } if (finish === undefined || finish < start) { - finish = this.length; + finish = this.size; } - let head: SinglyLinkedListNode | null | undefined = this.getNode(start); + let head: SinglyLinkedListNode | null | undefined = this.getNode(start); for (let i = 0; i < finish - start && head !== null && head !== undefined; i++) { list.append(head.val); head = head.next; @@ -595,13 +571,10 @@ export class SinglyLinkedList { } /** - * The reverse() function reverses the list in place and returns the list - * itself. - * ```ts - * new LinkedList(1, 2, 3).reverse(); // 3 <=> 2 <=> 1 - * ``` + * The reverse() function reverses the order of nodes in a singly linked list. + * @returns The reverse() method is returning the reversed SinglyLinkedList. */ - public reverse(): SinglyLinkedList { + reverse(): SinglyLinkedList { let currentNode = this.head; while (currentNode) { const next = currentNode.next; @@ -616,67 +589,67 @@ export class SinglyLinkedList { } /** - * The forEach() method executes a provided function once for each list node. - * ```ts - * new LinkedList(1, 2, 3).forEach(val => log(val)); // 1 2 3 - * ``` - * @param f Function to execute for each element, taking up to three arguments. - * @param reverse Indicates if the list should be walked in reverse order, default is false + * The `forEach` function iterates over a singly linked list and applies a callback function to each node, either in + * forward or reverse order. + * @param callbackFn - A callback function that will be called for each element in the linked list. It takes three + * parameters: + * @param [reverse=false] - A boolean value indicating whether to iterate over the linked list in reverse order. If set + * to true, the iteration will start from the tail of the linked list and move towards the head. If set to false + * (default), the iteration will start from the head and move towards the tail. */ - public forEach(f: ( + forEach(callbackFn: ( data: any, index: number, - list: SinglyLinkedList, + list: SinglyLinkedList, ) => any, reverse = false): void { - let currentIndex = reverse ? this.length - 1 : 0; + let currentIndex = reverse ? this.size - 1 : 0; let currentNode = reverse ? this.tail : this.head; const modifier = reverse ? -1 : 1; const nextNode = reverse ? 'prev' : 'next'; while (currentNode) { - f(currentNode.val, currentIndex, this); + callbackFn(currentNode.val, currentIndex, this); currentNode = currentNode[nextNode]; currentIndex += modifier; } } /** - * The map() method creates a new list with the results of - * calling a provided function on every node in the calling list. - * ```ts - * new LinkedList(1, 2, 3).map(val => val + 10); // 11 <=> 12 <=> 13 - * ``` - * @param f Function that produces an node of the new list, taking up to three arguments - * @param reverse Indicates if the list should be mapped in reverse order, default is false + * The map function takes a callback function and applies it to each element in the linked list, returning a new linked + * list with the results. + * @param callbackFn - A callback function that will be applied to each element in the linked list. It takes three + * parameters: + * @param [reverse=false] - The `reverse` parameter is a boolean value that determines whether the mapping should be + * done in reverse order or not. If `reverse` is set to `true`, the mapping will be done in reverse order. If `reverse` + * is set to `false` or not provided, the mapping will be + * @returns The `map` function is returning a new `SinglyLinkedList` object. */ - // eslint-disable-next-line @typescript-eslint/ban-types - public map(f: ( + map(callbackFn: ( data: any, index: number, - list: SinglyLinkedList, - ) => any, reverse = false): SinglyLinkedList { + list: SinglyLinkedList, + ) => any, reverse = false): SinglyLinkedList { const list = new SinglyLinkedList(); - this.forEach((val, index) => list.append(f(val, index, this)), reverse); + this.forEach((val, index) => list.append(callbackFn(val, index, this)), reverse); return list; } /** - * The filter() method creates a new list with all nodes - * that pass the test implemented by the provided function. - * ```ts - * new LinkedList(1, 2, 3, 4, 5).filter(val => val < 4); // 1 <=> 2 <=> 3 - * ``` - * @param f Function to test each node val in the list. Return true to keep the node - * @param reverse Indicates if the list should be filtered in reverse order, default is false + * The `filter` function filters the elements of a singly linked list based on a given callback function. + * @param callbackFn - A callback function that takes three parameters: data, index, and list. It should return a + * boolean value indicating whether the current element should be included in the filtered list or not. + * @param [reverse=false] - The `reverse` parameter is a boolean value that determines whether the filtered list should + * be reversed or not. If `reverse` is set to `true`, the filtered list will be in reverse order. If `reverse` is set + * to `false` or not provided, the filtered list will be in + * @returns The `filter` method is returning a new `SinglyLinkedList` object. */ - // eslint-disable-next-line @typescript-eslint/ban-types - public filter(f: ( - data: NodeData, + filter(callbackFn: ( + data: NodeVal, index: number, - list: SinglyLinkedList, - ) => boolean, reverse = false): SinglyLinkedList { + list: SinglyLinkedList, + ) => boolean, reverse = false): SinglyLinkedList { const list = new SinglyLinkedList(); this.forEach((val, index) => { - if (f(val, index, this)) { + if (callbackFn(val, index, this)) { list.append(val); } }, reverse); @@ -684,25 +657,30 @@ export class SinglyLinkedList { } /** - * Reduce over each node in the list - * ```ts - * new LinkedList(1, 2, 3).reduce(n => n += 1, 0); // 3 - * ``` - * @param f A reducer function - * @param start An initial value - * @returns The final state of the accumulator + * The `reduce` function iterates over a singly linked list and applies a callback function to each element, + * accumulating a single value. + * @param callbackFn - A callback function that will be called for each element in the linked list. It takes four + * parameters: + * @param {any} [start] - The `start` parameter is an optional initial value for the accumulator. If provided, the + * `reduce` function will start accumulating from this value. If not provided, the `reduce` function will use the value + * of the first element in the linked list as the initial value. + * @param [reverse=false] - A boolean value indicating whether to iterate over the linked list in reverse order. If set + * to true, the iteration will start from the tail of the linked list and move towards the head. If set to false + * (default), the iteration will start from the head and move towards the tail. + * @returns The `reduce` method returns the accumulated value after applying the callback function to each element in + * the linked list. */ - public reduce( - f: ( + reduce( + callbackFn: ( accumulator: any, - currentNode: NodeData, + currentNode: NodeVal, index: number, - list: SinglyLinkedList, + list: SinglyLinkedList, ) => any, start?: any, reverse = false, ): any { - let currentIndex = reverse ? this.length - 1 : 0; + let currentIndex = reverse ? this.size - 1 : 0; const modifier = reverse ? -1 : 1; const nextNode = reverse ? 'prev' : 'next'; let currentElement = reverse ? this.tail : this.head; @@ -718,7 +696,7 @@ export class SinglyLinkedList { } while (currentElement) { - result = f(result, currentElement.val, currentIndex, this); + result = callbackFn(result, currentElement.val, currentIndex, this); currentIndex += modifier; currentElement = currentElement[nextNode]; } @@ -727,34 +705,29 @@ export class SinglyLinkedList { } /** - * Convert the linked list to an array - * ```ts - * new LinkedList(1, 2, 3).toArray(); // [1, 2, 3] - * ``` + * The toArray() function converts a NodeVal object into an array of NodeVal objects. + * @returns An array of NodeVal objects. */ - public toArray(): NodeData[] { + toArray(): NodeVal[] { return [...this]; } /** - * Convert a linked list to string - * ```ts - * new LinkedList('one', 'two', 'three').toString(' <=> ') === 'one <=> two <=> three'; - * ``` - * @param separator Optional string to be placed in between val nodes, default is one space + * The `toString` function takes an optional separator and returns a string representation of an array, with each + * element separated by the specified separator. + * @param [separator= ] - The separator parameter is a string that specifies the character(s) to be used as a separator + * between each element in the array when converting it to a string. By default, the separator is set to a space + * character (' '). + * @returns The toString method is being returned as a string. */ - public toString(separator = ' '): string { + toString(separator = ' '): string { return this.reduce((s, val) => `${s}${separator}${val}`); } /** - * The iterator implementation - * ```ts - * const list = new LinkedList(1, 2, 3); - * for (const val of list) { log(val); } // 1 2 3 - * ``` + * The function is an iterator that returns the values of each node in a linked list. */ - public* [Symbol.iterator](): IterableIterator { + public* [Symbol.iterator](): IterableIterator { let element = this.head; while (element !== null) { @@ -763,8 +736,13 @@ export class SinglyLinkedList { } } - /** Private helper function to reduce duplication of pop() and shift() methods */ - private removeFromAnyEnd(node: SinglyLinkedListNode | null) { + /** + * The function removes a node from either end of a singly linked list and returns its value. + * @param {SinglyLinkedListNode | null} node - The `node` parameter is a reference to a node in a singly + * linked list. It can be either a `SinglyLinkedListNode` object or `null`. + * @returns The value of the removed node if the node is not null, otherwise undefined. + */ + protected removeFromAnyEnd(node: SinglyLinkedListNode | null) { return node !== null ? this.removeNode(node).val : undefined; } } diff --git a/src/data-structures/priority-queue/priority-queue.ts b/src/data-structures/priority-queue/priority-queue.ts index 172fa41..6a8ab92 100644 --- a/src/data-structures/priority-queue/priority-queue.ts +++ b/src/data-structures/priority-queue/priority-queue.ts @@ -8,8 +8,21 @@ import type {PriorityQueueComparator, PriorityQueueDFSOrderPattern, PriorityQueueOptions} from '../types'; export class PriorityQueue { - protected nodes: T[] = []; + protected _nodes: T[] = []; + get nodes(): T[] { + return this._nodes; + } + /** + * Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters. + */ + getNodes(): T[] { + return this._nodes; + } + protected set nodes(value: T[]) { + this._nodes = value; + } + /** * The constructor initializes a priority queue with the given options, including an array of nodes and a comparator * function. @@ -21,7 +34,7 @@ export class PriorityQueue { if (nodes && nodes instanceof Array && nodes.length > 0) { // TODO support distinct - this.nodes = Array.isArray(nodes) ? [...nodes] : []; + this._nodes = Array.isArray(nodes) ? [...nodes] : []; isFix && this._fix(); } } diff --git a/src/data-structures/queue/deque.ts b/src/data-structures/queue/deque.ts index ce8d508..ff535d3 100644 --- a/src/data-structures/queue/deque.ts +++ b/src/data-structures/queue/deque.ts @@ -17,20 +17,50 @@ export class Deque extends DoublyLinkedList { // O(n) time complexity of adding at the beginning and the end // todo tested slowest one export class ObjectDeque { - protected _nodes: { [key: number]: T } = {}; - protected _capacity = Number.MAX_SAFE_INTEGER; - protected _first: number = -1; - protected _last: number = -1; - protected _size: number = 0; + private _nodes: { [key: number]: T } = {}; + get nodes(): { [p: number]: T } { + return this._nodes; + } + protected set nodes(value: { [p: number]: T }) { + this._nodes = value; + } + + private _capacity = Number.MAX_SAFE_INTEGER; + get capacity(): number { + return this._capacity; + } + set capacity(value: number) { + this._capacity = value; + } + + private _first: number = -1; + get first(): number { + return this._first; + } + set first(value: number) { + this._first = value; + } + + private _last: number = -1; + get last(): number { + return this._last; + } + set last(value: number) { + this._last = value; + } + + private _size: number = 0; + get size(): number { + return this._size; + } + protected set size(value: number) { + this._size = value; + } constructor(capacity?: number) { if (capacity !== undefined) this._capacity = capacity; } - size() { - return this._size; - } - addFirst(value: T) { if (this._size === 0) { const mid = Math.floor(this._capacity / 2); diff --git a/src/data-structures/types/abstract-graph.ts b/src/data-structures/types/abstract-graph.ts index 074c618..6c6fc66 100644 --- a/src/data-structures/types/abstract-graph.ts +++ b/src/data-structures/types/abstract-graph.ts @@ -5,7 +5,7 @@ export type DijkstraResult = export interface IGraph { - containsVertex(vertexOrId: V | VertexId): boolean; + hasVertex(vertexOrId: V | VertexId): boolean; getVertex(vertexOrId: VertexId | V): V | null; @@ -23,9 +23,9 @@ export interface IGraph { edgesOf(vertexOrId: V | VertexId): E[]; - containsEdge(src: V | VertexId, dest: V | VertexId): boolean; + hasEdge(src: V | VertexId, dest: V | VertexId): boolean; - // containsEdge(e: E): boolean; + // hasEdge(e: E): boolean; getEdge(srcOrId: V | VertexId, destOrId: V | VertexId): E | null; diff --git a/tests/unit/data-structures/graph/directed-graph.test.ts b/tests/unit/data-structures/graph/directed-graph.test.ts index 7d034df..5f5ab85 100644 --- a/tests/unit/data-structures/graph/directed-graph.test.ts +++ b/tests/unit/data-structures/graph/directed-graph.test.ts @@ -1,13 +1,37 @@ -import { DirectedGraph, DirectedVertex, DirectedEdge } from '../../../../src'; +import {DirectedEdge, DirectedGraph, DirectedVertex, VertexId} from '../../../../src'; -// TODO too few unit tests -describe('DirectedGraph', () => { +class MyVertex extends DirectedVertex { + data: string; + + constructor(id: VertexId, data: string) { + super(id); + this.data = data; + } +} + +class MyEdge extends DirectedEdge { + data: string; + + constructor(v1: VertexId, v2: VertexId, weight: number, data: string) { + super(v1, v2, weight); + this.data = data; + } +} + +class MyGraph extends DirectedGraph { + constructor() { + super(); + } +} + +describe('DirectedGraph Test1', () => { let graph: DirectedGraph; beforeEach(() => { graph = new DirectedGraph(); }); + it('should add vertices', () => { const vertex1 = new DirectedVertex('A'); const vertex2 = new DirectedVertex('B'); @@ -15,8 +39,8 @@ describe('DirectedGraph', () => { graph.addVertex(vertex1); graph.addVertex(vertex2); - expect(graph.containsVertex(vertex1)).toBe(true); - expect(graph.containsVertex(vertex2)).toBe(true); + expect(graph.hasVertex(vertex1)).toBe(true); + expect(graph.hasVertex(vertex2)).toBe(true); }); it('should add edges', () => { @@ -28,8 +52,8 @@ describe('DirectedGraph', () => { graph.addVertex(vertex2); graph.addEdge(edge); - expect(graph.containsEdge('A', 'B')).toBe(true); - expect(graph.containsEdge('B', 'A')).toBe(false); + expect(graph.hasEdge('A', 'B')).toBe(true); + expect(graph.hasEdge('B', 'A')).toBe(false); }); it('should remove edges', () => { @@ -42,7 +66,7 @@ describe('DirectedGraph', () => { graph.addEdge(edge); expect(graph.removeEdge(edge)).toBe(edge); - expect(graph.containsEdge('A', 'B')).toBe(false); + expect(graph.hasEdge('A', 'B')).toBe(false); }); // Add more test cases for other methods... @@ -70,3 +94,402 @@ describe('DirectedGraph', () => { // Add more test cases for other methods... }); + + +describe('DirectedGraph Test2 operations', () => { + const myGraph = new DirectedGraph(); + + test('Add vertices', () => { + myGraph.addVertex(new MyVertex(1, 'data1')); + myGraph.addVertex(new MyVertex(2, 'data2')); + myGraph.addVertex(new MyVertex(3, 'data3')); + myGraph.addVertex(new MyVertex(4, 'data4')); + myGraph.addVertex(new MyVertex(5, 'data5')); + myGraph.addVertex(new MyVertex(6, 'data6')); + myGraph.addVertex(new MyVertex(7, 'data7')); + myGraph.addVertex(new MyVertex(8, 'data8')); + myGraph.addVertex(new MyVertex(9, 'data9')); + + }); + + test('Add edges', () => { + myGraph.addVertex(new MyVertex(1, 'data1')); + myGraph.addVertex(new MyVertex(2, 'data2')); + myGraph.addEdge(new MyEdge(1, 2, 10, 'edge-data1-2')); + myGraph.addEdge(new MyEdge(2, 1, 20, 'edge-data2-1')); + + expect(myGraph.edgeSet().length).toBe(2); + // TODO + expect(myGraph.getEdge(1, 2)).toBeInstanceOf(MyEdge); + expect(myGraph.getEdge(2, 1)).toBeInstanceOf(MyEdge); + }); + + test('Get edge', () => { + + const edge1 = myGraph.getEdge(1, 2); + const edge2 = myGraph.getEdge(myGraph.getVertex(1), myGraph.getVertex(2)); + const edge3 = myGraph.getEdge(1, '100'); + + expect(edge1).toBeInstanceOf(MyEdge); + edge1 && expect(edge1.src).toBe(1); + expect(edge1).toEqual(edge2); + expect(edge3).toBeNull(); + }); + + test('Edge set and vertex set', () => { + const edges = myGraph.edgeSet(); + const vertices = myGraph.vertexSet(); + + }); + + test('Remove edge between vertices', () => { + myGraph.addVertex(new MyVertex(1, 'data1')); + myGraph.addVertex(new MyVertex(2, 'data2')); + myGraph.addEdge(new MyEdge(1, 2, 10, 'edge-data1-2')); + + const removedEdge = myGraph.removeEdgeBetween(1, 2); + const edgeAfterRemoval = myGraph.getEdge(1, 2); + + expect(removedEdge).toBeInstanceOf(MyEdge); + if (removedEdge) { + removedEdge && expect(removedEdge.data).toBe('edge-data1-2'); + removedEdge && expect(removedEdge.src).toBe(1) + } + expect(edgeAfterRemoval).toBeNull(); + }); + + test('Topological sort', () => { + + const sorted = myGraph.topologicalSort(); + + expect(sorted).toBeInstanceOf(Array); + if (sorted && sorted.length > 0) { + expect(sorted.length).toBe(9); + expect(sorted[0].data).toBe('data9'); + expect(sorted[3].data).toBe('data6'); + expect(sorted[8].id).toBe(1); + } + + }); + + test('Minimum path between vertices', () => { + myGraph.addVertex(new MyVertex(1, 'data1')); + myGraph.addVertex(new MyVertex(2, 'data2')); + myGraph.addEdge(new MyEdge(1, 2, 10, 'edge-data1-2')); + + const minPath = myGraph.getMinPathBetween(1, 2); + }); + + test('All paths between vertices', () => { + // Add vertices and edges as needed for this test + myGraph.addVertex(new MyVertex(1, 'data1')); + myGraph.addVertex(new MyVertex(2, 'data2')); + myGraph.addEdge(new MyEdge(1, 2, 10, 'edge-data1-2')); + + const allPaths = myGraph.getAllPathsBetween(1, 2); + + // Add expect statements here to verify the allPaths + }); +}); + + +describe('DirectedGraph Test3', () => { + const myGraph = new DirectedGraph(); + + it('should test graph operations', () => { + const vertex1 = new MyVertex(1, 'data1'); + const vertex2 = new MyVertex(2, 'data2'); + const vertex3 = new MyVertex(3, 'data3'); + const vertex4 = new MyVertex(4, 'data4'); + const vertex5 = new MyVertex(5, 'data5'); + const vertex6 = new MyVertex(6, 'data6'); + const vertex7 = new MyVertex(7, 'data7'); + const vertex8 = new MyVertex(8, 'data8'); + const vertex9 = new MyVertex(9, 'data9'); + myGraph.addVertex(vertex1); + myGraph.addVertex(vertex2); + myGraph.addVertex(vertex3); + myGraph.addVertex(vertex4); + myGraph.addVertex(vertex5); + myGraph.addVertex(vertex6); + myGraph.addVertex(vertex7); + myGraph.addVertex(vertex8); + myGraph.addVertex(vertex9); + + myGraph.addEdge(new MyEdge(1, 2, 10, 'edge-data1-2')); + myGraph.addEdge(new MyEdge(2, 1, 20, 'edge-data2-1')); + + expect(myGraph.getEdge(1, 2)).toBeTruthy(); + expect(myGraph.getEdge(2, 1)).toBeTruthy(); + expect(myGraph.getEdge(1, '100')).toBeFalsy(); + + // Add the rest of your assertions here... + + myGraph.removeEdgeBetween(1, 2); + expect(myGraph.getEdge(1, 2)).toBeFalsy(); + + myGraph.addEdge(new MyEdge(3, 1, 3, 'edge-data-3-1')); + + myGraph.addEdge(new MyEdge(1, 9, 19, 'edge-data1-9')); + myGraph.addEdge(new MyEdge(9, 7, 97, 'edge-data9-7')); + + myGraph.addEdge(new MyEdge(7, 9, 79, 'edge-data7-9')); + + myGraph.addEdge(new MyEdge(1, 4, 14, 'edge-data1-4')); + + myGraph.addEdge(new MyEdge(4, 7, 47, 'edge-data4-7')); + + myGraph.addEdge(new MyEdge(1, 2, 12, 'edge-data1-2')); + + myGraph.addEdge(new MyEdge(2, 3, 23, 'edge-data2-3')); + + myGraph.addEdge(new MyEdge(3, 5, 35, 'edge-data3-5')); + + myGraph.addEdge(new MyEdge(5, 7, 57, 'edge-data5-7')); + + myGraph.addEdge(new MyEdge(7, 3, 73, 'edge-data7-3')); + const topologicalSorted = myGraph.topologicalSort(); + expect(topologicalSorted).toBeNull(); + + const minPath1to7 = myGraph.getMinPathBetween(1, 7); + + expect(minPath1to7).toBeInstanceOf(Array); + if (minPath1to7 && minPath1to7.length > 0) { + expect(minPath1to7).toHaveLength(3); + expect(minPath1to7[0]).toBeInstanceOf(MyVertex); + expect(minPath1to7[0].id).toBe(1); + expect(minPath1to7[1].id).toBe(9); + expect(minPath1to7[2].id).toBe(7); + } + + const fordResult1 = myGraph.bellmanFord(1); + expect(fordResult1).toBeTruthy(); + expect(fordResult1.hasNegativeCycle).toBeUndefined(); + const {distMap, preMap, paths, min, minPath} = fordResult1; + expect(distMap).toBeInstanceOf(Map); + expect(distMap.size).toBe(9); + expect(distMap.get(vertex1)).toBe(0); + expect(distMap.get(vertex2)).toBe(12); + expect(distMap.get(vertex3)).toBe(35); + expect(distMap.get(vertex4)).toBe(14); + expect(distMap.get(vertex5)).toBe(70); + expect(distMap.get(vertex6)).toBe(Infinity); + expect(distMap.get(vertex7)).toBe(61); + expect(distMap.get(vertex8)).toBe(Infinity); + expect(distMap.get(vertex9)).toBe(19); + + expect(preMap).toBeInstanceOf(Map); + expect(preMap.size).toBe(0); + + expect(paths).toBeInstanceOf(Array); + expect(paths.length).toBe(0); + expect(min).toBe(Infinity); + expect(minPath).toBeInstanceOf(Array); + + + const floydResult = myGraph.floyd(); + expect(floydResult).toBeTruthy(); + if (floydResult) { + const {costs, predecessor} = floydResult; + expect(costs).toBeInstanceOf(Array); + expect(costs.length).toBe(9); + expect(costs[0]).toEqual([32, 12, 35, 14, 70, Infinity, 61, Infinity, 19]); + expect(costs[1]).toEqual([20, 32, 23, 34, 58, Infinity, 81, Infinity, 39]); + expect(costs[2]).toEqual([3, 15, 38, 17, 35, Infinity, 64, Infinity, 22]); + expect(costs[3]).toEqual([123, 135, 120, 137, 155, Infinity, 47, Infinity, 126]); + expect(costs[4]).toEqual([133, 145, 130, 147, 165, Infinity, 57, Infinity, 136]); + expect(costs[5]).toEqual([Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity]); + expect(costs[6]).toEqual([76, 88, 73, 90, 108, Infinity, 137, Infinity, 79]); + expect(costs[7]).toEqual([Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity]); + expect(costs[8]).toEqual([173, 185, 170, 187, 205, Infinity, 97, Infinity, 176]); + + expect(predecessor).toBeInstanceOf(Array); + expect(predecessor.length).toBe(9); + expect(predecessor[0]).toEqual([vertex2, null, vertex2, null, vertex3, null, vertex4, null, null]); + expect(predecessor[1]).toEqual([null, vertex1, null, vertex1, vertex3, null, vertex4, null, vertex1]); + expect(predecessor[5]).toEqual([null, null, null, null, null, null, null, null, null]); + expect(predecessor[7]).toEqual([null, null, null, null, null, null, null, null, null]); + expect(predecessor[8]).toEqual([vertex7, vertex7, vertex7, vertex7, vertex7, null, null, null, vertex7]); + } + + const dijkstraRes12tt = myGraph.dijkstra(1, 2, true, true); + + expect(dijkstraRes12tt).toBeTruthy(); + if (dijkstraRes12tt) { + const {distMap, minDist, minPath, paths, preMap, seen} = dijkstraRes12tt; + expect(distMap).toBeInstanceOf(Map); + expect(distMap.size).toBe(9); + expect(distMap.get(vertex1)).toBe(0); + expect(distMap.get(vertex2)).toBe(12); + expect(distMap.get(vertex3)).toBe(Infinity); + expect(distMap.get(vertex4)).toBe(14); + expect(distMap.get(vertex5)).toBe(Infinity); + expect(distMap.get(vertex6)).toBe(Infinity); + expect(distMap.get(vertex7)).toBe(Infinity); + expect(distMap.get(vertex8)).toBe(Infinity); + expect(distMap.get(vertex9)).toBe(19); + + expect(minDist).toBe(12); + expect(minPath).toBeInstanceOf(Array); + expect(minPath.length).toBe(2); + expect(minPath[0]).toBe(vertex1); + expect(minPath[1]).toBe(vertex2); + + expect(paths).toBeInstanceOf(Array); + expect(paths.length).toBe(9); + expect(paths[0]).toBeInstanceOf(Array); + expect(paths[0][0]).toBe(vertex1); + + expect(paths[1]).toBeInstanceOf(Array); + expect(paths[1][0]).toBe(vertex1); + expect(paths[1][1]).toBe(vertex2); + + expect(paths[2]).toBeInstanceOf(Array); + expect(paths[2][0]).toBe(vertex3); + expect(paths[3]).toBeInstanceOf(Array); + expect(paths[3][0]).toBe(vertex1); + expect(paths[3][1]).toBe(vertex4); + expect(paths[4]).toBeInstanceOf(Array); + expect(paths[4][0]).toBe(vertex5); + + expect(paths[5]).toBeInstanceOf(Array); + expect(paths[5][0]).toBe(vertex6); + expect(paths[6]).toBeInstanceOf(Array); + expect(paths[6][0]).toBe(vertex7); + expect(paths[7]).toBeInstanceOf(Array); + expect(paths[7][0]).toBe(vertex8); + expect(paths[8]).toBeInstanceOf(Array); + expect(paths[8][0]).toBe(vertex1); + expect(paths[8][1]).toBe(vertex9); + + } + + const dijkstraRes1ntt = myGraph.dijkstra(1, null, true, true); + + expect(dijkstraRes1ntt).toBeTruthy(); + if (dijkstraRes1ntt) { + const {distMap, minDist, minPath, paths, preMap, seen} = dijkstraRes1ntt; + expect(distMap).toBeInstanceOf(Map); + expect(distMap.size).toBe(9); + expect(distMap.get(vertex1)).toBe(0); + expect(distMap.get(vertex2)).toBe(12); + expect(distMap.get(vertex3)).toBe(35); + expect(distMap.get(vertex4)).toBe(14); + expect(distMap.get(vertex5)).toBe(70); + expect(distMap.get(vertex6)).toBe(Infinity); + expect(distMap.get(vertex7)).toBe(61); + expect(distMap.get(vertex8)).toBe(Infinity); + expect(distMap.get(vertex9)).toBe(19); + + expect(minDist).toBe(12); + expect(minPath).toBeInstanceOf(Array); + expect(minPath.length).toBe(2); + expect(minPath[0]).toBe(vertex1); + expect(minPath[1]).toBe(vertex2); + + expect(paths).toBeInstanceOf(Array); + expect(paths.length).toBe(9); + expect(paths[0]).toBeInstanceOf(Array); + expect(paths[0][0]).toBe(vertex1); + + expect(paths[1]).toBeInstanceOf(Array); + expect(paths[1][0]).toBe(vertex1); + expect(paths[1][1]).toBe(vertex2); + + expect(paths[2]).toBeInstanceOf(Array); + expect(paths[2][0]).toBe(vertex1); + expect(paths[2][1]).toBe(vertex2); + expect(paths[2][2]).toBe(vertex3); + + expect(paths[3]).toBeInstanceOf(Array); + expect(paths[3][0]).toBe(vertex1); + expect(paths[3][1]).toBe(vertex4); + + expect(paths[4]).toBeInstanceOf(Array); + expect(paths[4][0]).toBe(vertex1); + expect(paths[4][1]).toBe(vertex2); + expect(paths[4][2]).toBe(vertex3); + expect(paths[4][3]).toBe(vertex5); + + expect(paths[5]).toBeInstanceOf(Array); + expect(paths[5][0]).toBe(vertex6); + + expect(paths[6]).toBeInstanceOf(Array); + expect(paths[6][0]).toBe(vertex1); + expect(paths[6][1]).toBe(vertex4); + expect(paths[6][2]).toBe(vertex7); + + expect(paths[7]).toBeInstanceOf(Array); + expect(paths[7][0]).toBe(vertex8); + + expect(paths[8]).toBeInstanceOf(Array); + expect(paths[8][0]).toBe(vertex1); + expect(paths[8][1]).toBe(vertex9); + + } + + const dijkstraWithoutHeapRes1ntt = myGraph.dijkstraWithoutHeap(1, null, true, true); + expect(dijkstraWithoutHeapRes1ntt).toBeTruthy(); + if (dijkstraWithoutHeapRes1ntt) { + const {distMap, minDist, minPath, paths, preMap, seen} = dijkstraWithoutHeapRes1ntt; + expect(distMap).toBeInstanceOf(Map); + expect(distMap.size).toBe(9); + expect(distMap.get(vertex1)).toBe(0); + expect(distMap.get(vertex2)).toBe(12); + expect(distMap.get(vertex3)).toBe(35); + expect(distMap.get(vertex4)).toBe(14); + expect(distMap.get(vertex5)).toBe(70); + expect(distMap.get(vertex6)).toBe(Infinity); + expect(distMap.get(vertex7)).toBe(61); + expect(distMap.get(vertex8)).toBe(Infinity); + expect(distMap.get(vertex9)).toBe(19); + + expect(minDist).toBe(12); + expect(minPath).toBeInstanceOf(Array); + expect(minPath.length).toBe(2); + expect(minPath[0]).toBe(vertex1); + expect(minPath[1]).toBe(vertex2); + + expect(paths).toBeInstanceOf(Array); + expect(paths.length).toBe(9); + expect(paths[0]).toBeInstanceOf(Array); + expect(paths[0][0]).toBe(vertex1); + + expect(paths[1]).toBeInstanceOf(Array); + expect(paths[1][0]).toBe(vertex1); + expect(paths[1][1]).toBe(vertex2); + + expect(paths[2]).toBeInstanceOf(Array); + expect(paths[2][0]).toBe(vertex1); + expect(paths[2][1]).toBe(vertex2); + expect(paths[2][2]).toBe(vertex3); + + expect(paths[3]).toBeInstanceOf(Array); + expect(paths[3][0]).toBe(vertex1); + expect(paths[3][1]).toBe(vertex4); + + expect(paths[4]).toBeInstanceOf(Array); + expect(paths[4][0]).toBe(vertex1); + expect(paths[4][1]).toBe(vertex2); + expect(paths[4][2]).toBe(vertex3); + expect(paths[4][3]).toBe(vertex5); + + expect(paths[5]).toBeInstanceOf(Array); + expect(paths[5][0]).toBe(vertex6); + + expect(paths[6]).toBeInstanceOf(Array); + expect(paths[6][0]).toBe(vertex1); + expect(paths[6][1]).toBe(vertex4); + expect(paths[6][2]).toBe(vertex7); + + expect(paths[7]).toBeInstanceOf(Array); + expect(paths[7][0]).toBe(vertex8); + + expect(paths[8]).toBeInstanceOf(Array); + expect(paths[8][0]).toBe(vertex1); + expect(paths[8][1]).toBe(vertex9); + + } + }); +}); +