focus-trap 7.4.3 → 7.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,4 +1,10 @@
1
- import { tabbable, focusable, isFocusable, isTabbable } from 'tabbable';
1
+ import {
2
+ tabbable,
3
+ focusable,
4
+ isFocusable,
5
+ isTabbable,
6
+ getTabIndex,
7
+ } from 'tabbable';
2
8
 
3
9
  const activeFocusTraps = {
4
10
  activateTrap(trapStack, trap) {
@@ -40,11 +46,11 @@ const isSelectableInput = function (node) {
40
46
  };
41
47
 
42
48
  const isEscapeEvent = function (e) {
43
- return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
49
+ return e?.key === 'Escape' || e?.key === 'Esc' || e?.keyCode === 27;
44
50
  };
45
51
 
46
52
  const isTabEvent = function (e) {
47
- return e.key === 'Tab' || e.keyCode === 9;
53
+ return e?.key === 'Tab' || e?.keyCode === 9;
48
54
  };
49
55
 
50
56
  // checks for TAB by default
@@ -136,8 +142,11 @@ const createFocusTrap = function (elements, userOptions) {
136
142
  // container: HTMLElement,
137
143
  // tabbableNodes: Array<HTMLElement>, // empty if none
138
144
  // focusableNodes: Array<HTMLElement>, // empty if none
139
- // firstTabbableNode: HTMLElement|null,
140
- // lastTabbableNode: HTMLElement|null,
145
+ // posTabIndexesFound: boolean,
146
+ // firstTabbableNode: HTMLElement|undefined,
147
+ // lastTabbableNode: HTMLElement|undefined,
148
+ // firstDomTabbableNode: HTMLElement|undefined,
149
+ // lastDomTabbableNode: HTMLElement|undefined,
141
150
  // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
142
151
  // }>}
143
152
  containerGroups: [], // same order/length as `containers` list
@@ -156,6 +165,9 @@ const createFocusTrap = function (elements, userOptions) {
156
165
  // timer ID for when delayInitialFocus is true and initial focus in this trap
157
166
  // has been delayed during activation
158
167
  delayInitialFocusTimer: undefined,
168
+
169
+ // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
170
+ recentNavEvent: undefined,
159
171
  };
160
172
 
161
173
  let trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
@@ -178,7 +190,9 @@ const createFocusTrap = function (elements, userOptions) {
178
190
  /**
179
191
  * Finds the index of the container that contains the element.
180
192
  * @param {HTMLElement} element
181
- * @param {Event} [event]
193
+ * @param {Event} [event] If available, and `element` isn't directly found in any container,
194
+ * the event's composed path is used to see if includes any known trap containers in the
195
+ * case where the element is inside a Shadow DOM.
182
196
  * @returns {number} Index of the container in either `state.containers` or
183
197
  * `state.containerGroups` (the order/length of these lists are the same); -1
184
198
  * if the element isn't found.
@@ -288,18 +302,52 @@ const createFocusTrap = function (elements, userOptions) {
288
302
  const tabbableNodes = tabbable(container, config.tabbableOptions);
289
303
 
290
304
  // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
291
- // are a superset of tabbable nodes
305
+ // are a superset of tabbable nodes since nodes with negative `tabindex` attributes
306
+ // are focusable but not tabbable
292
307
  const focusableNodes = focusable(container, config.tabbableOptions);
293
308
 
309
+ const firstTabbableNode =
310
+ tabbableNodes.length > 0 ? tabbableNodes[0] : undefined;
311
+ const lastTabbableNode =
312
+ tabbableNodes.length > 0
313
+ ? tabbableNodes[tabbableNodes.length - 1]
314
+ : undefined;
315
+
316
+ const firstDomTabbableNode = focusableNodes.find((node) =>
317
+ isTabbable(node)
318
+ );
319
+ const lastDomTabbableNode = focusableNodes.findLast((node) =>
320
+ isTabbable(node)
321
+ );
322
+
323
+ const posTabIndexesFound = !!tabbableNodes.find(
324
+ (node) => getTabIndex(node) > 0
325
+ );
326
+
294
327
  return {
295
328
  container,
296
329
  tabbableNodes,
297
330
  focusableNodes,
298
- firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
299
- lastTabbableNode:
300
- tabbableNodes.length > 0
301
- ? tabbableNodes[tabbableNodes.length - 1]
302
- : null,
331
+
332
+ /** True if at least one node with positive `tabindex` was found in this container. */
333
+ posTabIndexesFound,
334
+
335
+ /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
336
+ firstTabbableNode,
337
+ /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
338
+ lastTabbableNode,
339
+
340
+ // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
341
+ // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
342
+ // because that API doesn't work with Shadow DOM as well as it should (@see
343
+ // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
344
+ // to address an edge case related to positive tabindex support, this seems like a much easier,
345
+ // "close enough most of the time" alternative for positive tabindexes which should generally
346
+ // be avoided anyway...
347
+ /** First tabbable node in container, __DOM__ order; `undefined` if none. */
348
+ firstDomTabbableNode,
349
+ /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
350
+ lastDomTabbableNode,
303
351
 
304
352
  /**
305
353
  * Finds the __tabbable__ node that follows the given node in the specified direction,
@@ -310,31 +358,26 @@ const createFocusTrap = function (elements, userOptions) {
310
358
  * @returns {HTMLElement|undefined} The next tabbable node, if any.
311
359
  */
312
360
  nextTabbableNode(node, forward = true) {
313
- // NOTE: If tabindex is positive (in order to manipulate the tab order separate
314
- // from the DOM order), this __will not work__ because the list of focusableNodes,
315
- // while it contains tabbable nodes, does not sort its nodes in any order other
316
- // than DOM order, because it can't: Where would you place focusable (but not
317
- // tabbable) nodes in that order? They have no order, because they aren't tabbale...
318
- // Support for positive tabindex is already broken and hard to manage (possibly
319
- // not supportable, TBD), so this isn't going to make things worse than they
320
- // already are, and at least makes things better for the majority of cases where
321
- // tabindex is either 0/unset or negative.
322
- // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
323
- const nodeIdx = focusableNodes.findIndex((n) => n === node);
361
+ const nodeIdx = tabbableNodes.indexOf(node);
324
362
  if (nodeIdx < 0) {
325
- return undefined;
326
- }
363
+ // either not tabbable nor focusable, or was focused but not tabbable (negative tabindex):
364
+ // since `node` should at least have been focusable, we assume that's the case and mimic
365
+ // what browsers do, which is set focus to the next node in __document position order__,
366
+ // regardless of positive tabindexes, if any -- and for reasons explained in the NOTE
367
+ // above related to `firstDomTabbable` and `lastDomTabbable` properties, we fall back to
368
+ // basic DOM order
369
+ if (forward) {
370
+ return focusableNodes
371
+ .slice(focusableNodes.indexOf(node) + 1)
372
+ .find((el) => isTabbable(el));
373
+ }
327
374
 
328
- if (forward) {
329
375
  return focusableNodes
330
- .slice(nodeIdx + 1)
331
- .find((n) => isTabbable(n, config.tabbableOptions));
376
+ .slice(0, focusableNodes.indexOf(node))
377
+ .findLast((el) => isTabbable(el));
332
378
  }
333
379
 
334
- return focusableNodes
335
- .slice(0, nodeIdx)
336
- .reverse()
337
- .find((n) => isTabbable(n, config.tabbableOptions));
380
+ return tabbableNodes[nodeIdx + (forward ? 1 : -1)];
338
381
  },
339
382
  };
340
383
  });
@@ -352,6 +395,22 @@ const createFocusTrap = function (elements, userOptions) {
352
395
  'Your focus-trap must have at least one container with at least one tabbable node in it at all times'
353
396
  );
354
397
  }
398
+
399
+ // NOTE: Positive tabindexes are only properly supported in single-container traps because
400
+ // doing it across multiple containers where tabindexes could be all over the place
401
+ // would require Tabbable to support multiple containers, would require additional
402
+ // specialized Shadow DOM support, and would require Tabbable's multi-container support
403
+ // to look at those containers in document position order rather than user-provided
404
+ // order (as they are treated in Focus-trap, for legacy reasons). See discussion on
405
+ // https://github.com/focus-trap/focus-trap/issues/375 for more details.
406
+ if (
407
+ state.containerGroups.find((g) => g.posTabIndexesFound) &&
408
+ state.containerGroups.length > 1
409
+ ) {
410
+ throw new Error(
411
+ "At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps."
412
+ );
413
+ }
355
414
  };
356
415
 
357
416
  const tryFocus = function (node) {
@@ -369,6 +428,7 @@ const createFocusTrap = function (elements, userOptions) {
369
428
  }
370
429
 
371
430
  node.focus({ preventScroll: !!config.preventScroll });
431
+ // NOTE: focus() API does not trigger focusIn event so set MRU node manually
372
432
  state.mostRecentlyFocusedNode = node;
373
433
 
374
434
  if (isSelectableInput(node)) {
@@ -381,65 +441,19 @@ const createFocusTrap = function (elements, userOptions) {
381
441
  return node ? node : node === false ? false : previousActiveElement;
382
442
  };
383
443
 
384
- // This needs to be done on mousedown and touchstart instead of click
385
- // so that it precedes the focus event.
386
- const checkPointerDown = function (e) {
387
- const target = getActualTarget(e);
388
-
389
- if (findContainerIndex(target, e) >= 0) {
390
- // allow the click since it ocurred inside the trap
391
- return;
392
- }
393
-
394
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
395
- // immediately deactivate the trap
396
- trap.deactivate({
397
- // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
398
- // which will result in the outside click setting focus to the node
399
- // that was clicked (and if not focusable, to "nothing"); by setting
400
- // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
401
- // on activation (or the configured `setReturnFocus` node), whether the
402
- // outside click was on a focusable node or not
403
- returnFocus: config.returnFocusOnDeactivate,
404
- });
405
- return;
406
- }
407
-
408
- // This is needed for mobile devices.
409
- // (If we'll only let `click` events through,
410
- // then on mobile they will be blocked anyways if `touchstart` is blocked.)
411
- if (valueOrHandler(config.allowOutsideClick, e)) {
412
- // allow the click outside the trap to take place
413
- return;
414
- }
415
-
416
- // otherwise, prevent the click
417
- e.preventDefault();
418
- };
419
-
420
- // In case focus escapes the trap for some strange reason, pull it back in.
421
- const checkFocusIn = function (e) {
422
- const target = getActualTarget(e);
423
- const targetContained = findContainerIndex(target, e) >= 0;
424
-
425
- // In Firefox when you Tab out of an iframe the Document is briefly focused.
426
- if (targetContained || target instanceof Document) {
427
- if (targetContained) {
428
- state.mostRecentlyFocusedNode = target;
429
- }
430
- } else {
431
- // escaped! pull it back in to where it just left
432
- e.stopImmediatePropagation();
433
- tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
434
- }
435
- };
436
-
437
- // Hijack key nav events on the first and last focusable nodes of the trap,
438
- // in order to prevent focus from escaping. If it escapes for even a
439
- // moment it can end up scrolling the page and causing confusion so we
440
- // kind of need to capture the action at the keydown phase.
441
- const checkKeyNav = function (event, isBackward = false) {
442
- const target = getActualTarget(event);
444
+ /**
445
+ * Finds the next node (in either direction) where focus should move according to a
446
+ * keyboard focus-in event.
447
+ * @param {Object} params
448
+ * @param {Node} [params.target] Known target __from which__ to navigate, if any.
449
+ * @param {KeyboardEvent|FocusEvent} [params.event] Event to use if `target` isn't known (event
450
+ * will be used to determine the `target`). Ignored if `target` is specified.
451
+ * @param {boolean} [params.isBackward] True if focus should move backward.
452
+ * @returns {Node|undefined} The next node, or `undefined` if a next node couldn't be
453
+ * determined given the current state of the trap.
454
+ */
455
+ const findNextNavNode = function ({ target, event, isBackward = false }) {
456
+ target = target || getActualTarget(event);
443
457
  updateTabbableNodes();
444
458
 
445
459
  let destinationNode = null;
@@ -499,7 +513,11 @@ const createFocusTrap = function (elements, userOptions) {
499
513
  : startOfGroupIndex - 1;
500
514
 
501
515
  const destinationGroup = state.tabbableGroups[destinationGroupIndex];
502
- destinationNode = destinationGroup.lastTabbableNode;
516
+
517
+ destinationNode =
518
+ getTabIndex(target) >= 0
519
+ ? destinationGroup.lastTabbableNode
520
+ : destinationGroup.lastDomTabbableNode;
503
521
  } else if (!isTabEvent(event)) {
504
522
  // user must have customized the nav keys so we have to move focus manually _within_
505
523
  // the active group: do this based on the order determined by tabbable()
@@ -540,7 +558,11 @@ const createFocusTrap = function (elements, userOptions) {
540
558
  : lastOfGroupIndex + 1;
541
559
 
542
560
  const destinationGroup = state.tabbableGroups[destinationGroupIndex];
543
- destinationNode = destinationGroup.firstTabbableNode;
561
+
562
+ destinationNode =
563
+ getTabIndex(target) >= 0
564
+ ? destinationGroup.firstTabbableNode
565
+ : destinationGroup.firstDomTabbableNode;
544
566
  } else if (!isTabEvent(event)) {
545
567
  // user must have customized the nav keys so we have to move focus manually _within_
546
568
  // the active group: do this based on the order determined by tabbable()
@@ -553,6 +575,157 @@ const createFocusTrap = function (elements, userOptions) {
553
575
  destinationNode = getNodeForOption('fallbackFocus');
554
576
  }
555
577
 
578
+ return destinationNode;
579
+ };
580
+
581
+ // This needs to be done on mousedown and touchstart instead of click
582
+ // so that it precedes the focus event.
583
+ const checkPointerDown = function (e) {
584
+ const target = getActualTarget(e);
585
+
586
+ if (findContainerIndex(target, e) >= 0) {
587
+ // allow the click since it ocurred inside the trap
588
+ return;
589
+ }
590
+
591
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
592
+ // immediately deactivate the trap
593
+ trap.deactivate({
594
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
595
+ // which will result in the outside click setting focus to the node
596
+ // that was clicked (and if not focusable, to "nothing"); by setting
597
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
598
+ // on activation (or the configured `setReturnFocus` node), whether the
599
+ // outside click was on a focusable node or not
600
+ returnFocus: config.returnFocusOnDeactivate,
601
+ });
602
+ return;
603
+ }
604
+
605
+ // This is needed for mobile devices.
606
+ // (If we'll only let `click` events through,
607
+ // then on mobile they will be blocked anyways if `touchstart` is blocked.)
608
+ if (valueOrHandler(config.allowOutsideClick, e)) {
609
+ // allow the click outside the trap to take place
610
+ return;
611
+ }
612
+
613
+ // otherwise, prevent the click
614
+ e.preventDefault();
615
+ };
616
+
617
+ // In case focus escapes the trap for some strange reason, pull it back in.
618
+ // NOTE: the focusIn event is NOT cancelable, so if focus escapes, it may cause unexpected
619
+ // scrolling if the node that got focused was out of view; there's nothing we can do to
620
+ // prevent that from happening by the time we discover that focus escaped
621
+ const checkFocusIn = function (event) {
622
+ const target = getActualTarget(event);
623
+ const targetContained = findContainerIndex(target, event) >= 0;
624
+
625
+ // In Firefox when you Tab out of an iframe the Document is briefly focused.
626
+ if (targetContained || target instanceof Document) {
627
+ if (targetContained) {
628
+ state.mostRecentlyFocusedNode = target;
629
+ }
630
+ } else {
631
+ // escaped! pull it back in to where it just left
632
+ event.stopImmediatePropagation();
633
+
634
+ // focus will escape if the MRU node had a positive tab index and user tried to nav forward;
635
+ // it will also escape if the MRU node had a 0 tab index and user tried to nav backward
636
+ // toward a node with a positive tab index
637
+ let nextNode; // next node to focus, if we find one
638
+ let navAcrossContainers = true;
639
+ if (state.mostRecentlyFocusedNode) {
640
+ if (getTabIndex(state.mostRecentlyFocusedNode) > 0) {
641
+ // MRU container index must be >=0 otherwise we wouldn't have it as an MRU node...
642
+ const mruContainerIdx = findContainerIndex(
643
+ state.mostRecentlyFocusedNode
644
+ );
645
+ // there MAY not be any tabbable nodes in the container if there are at least 2 containers
646
+ // and the MRU node is focusable but not tabbable (focus-trap requires at least 1 container
647
+ // with at least one tabbable node in order to function, so this could be the other container
648
+ // with nothing tabbable in it)
649
+ const { tabbableNodes } = state.containerGroups[mruContainerIdx];
650
+ if (tabbableNodes.length > 0) {
651
+ // MRU tab index MAY not be found if the MRU node is focusable but not tabbable
652
+ const mruTabIdx = tabbableNodes.findIndex(
653
+ (node) => node === state.mostRecentlyFocusedNode
654
+ );
655
+ if (mruTabIdx >= 0) {
656
+ if (config.isKeyForward(state.recentNavEvent)) {
657
+ if (mruTabIdx + 1 < tabbableNodes.length) {
658
+ nextNode = tabbableNodes[mruTabIdx + 1];
659
+ navAcrossContainers = false;
660
+ }
661
+ // else, don't wrap within the container as focus should move to next/previous
662
+ // container
663
+ } else {
664
+ if (mruTabIdx - 1 >= 0) {
665
+ nextNode = tabbableNodes[mruTabIdx - 1];
666
+ navAcrossContainers = false;
667
+ }
668
+ // else, don't wrap within the container as focus should move to next/previous
669
+ // container
670
+ }
671
+ // else, don't find in container order without considering direction too
672
+ }
673
+ }
674
+ // else, no tabbable nodes in that container (which means we must have at least one other
675
+ // container with at least one tabbable node in it, otherwise focus-trap would've thrown
676
+ // an error the last time updateTabbableNodes() was run): find next node among all known
677
+ // containers
678
+ } else {
679
+ // check to see if there's at least one tabbable node with a positive tab index inside
680
+ // the trap because focus seems to escape when navigating backward from a tabbable node
681
+ // with tabindex=0 when this is the case (instead of wrapping to the tabbable node with
682
+ // the greatest positive tab index like it should)
683
+ if (
684
+ !state.containerGroups.some((g) =>
685
+ g.tabbableNodes.some((n) => getTabIndex(n) > 0)
686
+ )
687
+ ) {
688
+ // no containers with tabbable nodes with positive tab indexes which means the focus
689
+ // escaped for some other reason and we should just execute the fallback to the
690
+ // MRU node or initial focus node, if any
691
+ navAcrossContainers = false;
692
+ }
693
+ }
694
+ } else {
695
+ // no MRU node means we're likely in some initial condition when the trap has just
696
+ // been activated and initial focus hasn't been given yet, in which case we should
697
+ // fall through to trying to focus the initial focus node, which is what should
698
+ // happen below at this point in the logic
699
+ navAcrossContainers = false;
700
+ }
701
+
702
+ if (navAcrossContainers) {
703
+ nextNode = findNextNavNode({
704
+ // move FROM the MRU node, not event-related node (which will be the node that is
705
+ // outside the trap causing the focus escape we're trying to fix)
706
+ target: state.mostRecentlyFocusedNode,
707
+ isBackward: config.isKeyBackward(state.recentNavEvent),
708
+ });
709
+ }
710
+
711
+ if (nextNode) {
712
+ tryFocus(nextNode);
713
+ } else {
714
+ tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
715
+ }
716
+ }
717
+
718
+ state.recentNavEvent = undefined; // clear
719
+ };
720
+
721
+ // Hijack key nav events on the first and last focusable nodes of the trap,
722
+ // in order to prevent focus from escaping. If it escapes for even a
723
+ // moment it can end up scrolling the page and causing confusion so we
724
+ // kind of need to capture the action at the keydown phase.
725
+ const checkKeyNav = function (event, isBackward = false) {
726
+ state.recentNavEvent = event;
727
+
728
+ const destinationNode = findNextNavNode({ event, isBackward });
556
729
  if (destinationNode) {
557
730
  if (isTabEvent(event)) {
558
731
  // since tab natively moves focus, we wouldn't have a destination node unless we
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "focus-trap",
3
- "version": "7.4.3",
3
+ "version": "7.5.1",
4
4
  "description": "Trap focus within a DOM node.",
5
5
  "main": "dist/focus-trap.js",
6
6
  "module": "dist/focus-trap.esm.js",
@@ -63,28 +63,29 @@
63
63
  },
64
64
  "homepage": "https://github.com/focus-trap/focus-trap#readme",
65
65
  "dependencies": {
66
- "tabbable": "^6.1.2"
66
+ "tabbable": "^6.2.0"
67
67
  },
68
68
  "devDependencies": {
69
- "@babel/cli": "^7.21.5",
70
- "@babel/core": "^7.21.8",
71
- "@babel/eslint-parser": "^7.21.8",
72
- "@babel/preset-env": "^7.21.5",
73
- "@changesets/cli": "^2.26.1",
69
+ "@babel/cli": "^7.22.5",
70
+ "@babel/core": "^7.22.5",
71
+ "@babel/eslint-parser": "^7.22.5",
72
+ "@babel/preset-env": "^7.22.5",
73
+ "@changesets/cli": "^2.26.2",
74
74
  "@rollup/plugin-babel": "^6.0.3",
75
- "@rollup/plugin-commonjs": "^25.0.0",
76
- "@rollup/plugin-node-resolve": "^15.0.2",
75
+ "@rollup/plugin-commonjs": "^25.0.2",
76
+ "@rollup/plugin-node-resolve": "^15.1.0",
77
+ "@rollup/plugin-terser": "^0.4.3",
77
78
  "@testing-library/cypress": "^9.0.0",
78
79
  "@types/jquery": "^3.5.16",
79
- "all-contributors-cli": "^6.25.1",
80
+ "all-contributors-cli": "^6.26.0",
80
81
  "babel-loader": "^9.1.2",
81
82
  "cross-env": "^7.0.3",
82
- "cypress": "^12.12.0",
83
+ "cypress": "^12.16.0",
83
84
  "cypress-plugin-tab": "^1.0.5",
84
- "eslint": "^8.40.0",
85
+ "eslint": "^8.43.0",
85
86
  "eslint-config-prettier": "^8.8.0",
86
87
  "eslint-plugin-cypress": "^2.13.3",
87
- "eslint-plugin-jest": "^27.2.1",
88
+ "eslint-plugin-jest": "^27.2.2",
88
89
  "onchange": "^7.1.0",
89
90
  "prettier": "^2.8.8",
90
91
  "rollup": "^2.79.1",
@@ -92,8 +93,7 @@
92
93
  "rollup-plugin-livereload": "^2.0.5",
93
94
  "rollup-plugin-serve": "^2.0.2",
94
95
  "rollup-plugin-sourcemaps": "^0.6.3",
95
- "rollup-plugin-terser": "^7.0.1",
96
96
  "start-server-and-test": "^2.0.0",
97
- "typescript": "^5.0.4"
97
+ "typescript": "^5.1.5"
98
98
  }
99
99
  }