• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

twbs / bootstrap / 15283895011

27 May 2025 07:22PM CUT coverage: 95.999% (-0.07%) from 96.07%
15283895011

push

github

web-flow
Build(deps-dev): Bump the development-dependencies group with 8 updates (#41502)

Bumps the development-dependencies group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@astrojs/markdown-remark](https://github.com/withastro/astro/tree/HEAD/packages/markdown/remark) | `6.3.1` | `6.3.2` |
| [@astrojs/mdx](https://github.com/withastro/astro/tree/HEAD/packages/integrations/mdx) | `4.2.6` | `4.3.0` |
| [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) | `7.27.1` | `7.27.3` |
| [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) | `5.7.13` | `5.8.0` |
| [npm-run-all2](https://github.com/bcomnes/npm-run-all2) | `8.0.2` | `8.0.4` |
| [rollup](https://github.com/rollup/rollup) | `4.41.0` | `4.41.1` |
| [terser](https://github.com/terser/terser) | `5.39.2` | `5.40.0` |
| [zod](https://github.com/colinhacks/zod) | `3.25.7` | `3.25.30` |



Updates `@astrojs/markdown-remark` from 6.3.1 to 6.3.2
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/markdown/remark/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/markdown-remark@6.3.2/packages/markdown/remark)

Updates `@astrojs/mdx` from 4.2.6 to 4.3.0
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/integrations/mdx/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/mdx@4.3.0/packages/integrations/mdx)

Updates `@astrojs/prism` from 3.2.0 to 3.3.0
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro-prism/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/prism@3.3.0/packages/astro-prism)

Updates `@babel/core` from 7.27.1 to 7.27.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://gi... (continued)

665 of 726 branches covered (91.6%)

Branch coverage included in aggregate %.

2022 of 2073 relevant lines covered (97.54%)

194.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.89
/js/src/util/swipe.js
1
/**
2
 * --------------------------------------------------------------------------
3
 * Bootstrap util/swipe.js
4
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
 * --------------------------------------------------------------------------
6
 */
7

8
import EventHandler from '../dom/event-handler.js'
9
import Config from './config.js'
10
import { execute } from './index.js'
11

12
/**
13
 * Constants
14
 */
15

16
const NAME = 'swipe'
2✔
17
const EVENT_KEY = '.bs.swipe'
2✔
18
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`
2✔
19
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`
2✔
20
const EVENT_TOUCHEND = `touchend${EVENT_KEY}`
2✔
21
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`
2✔
22
const EVENT_POINTERUP = `pointerup${EVENT_KEY}`
2✔
23
const POINTER_TYPE_TOUCH = 'touch'
2✔
24
const POINTER_TYPE_PEN = 'pen'
2✔
25
const CLASS_NAME_POINTER_EVENT = 'pointer-event'
2✔
26
const SWIPE_THRESHOLD = 40
2✔
27

28
const Default = {
2✔
29
  endCallback: null,
30
  leftCallback: null,
31
  rightCallback: null
32
}
33

34
const DefaultType = {
2✔
35
  endCallback: '(function|null)',
36
  leftCallback: '(function|null)',
37
  rightCallback: '(function|null)'
38
}
39

40
/**
41
 * Class definition
42
 */
43

44
class Swipe extends Config {
45
  constructor(element, config) {
46
    super()
28✔
47
    this._element = element
28✔
48

49
    if (!element || !Swipe.isSupported()) {
28✔
50
      return
2✔
51
    }
52

53
    this._config = this._getConfig(config)
26✔
54
    this._deltaX = 0
26✔
55
    this._supportPointerEvents = Boolean(window.PointerEvent)
26✔
56
    this._initEvents()
26✔
57
  }
58

59
  // Getters
60
  static get Default() {
61
    return Default
26✔
62
  }
63

64
  static get DefaultType() {
65
    return DefaultType
26✔
66
  }
67

68
  static get NAME() {
69
    return NAME
×
70
  }
71

72
  // Public
73
  dispose() {
74
    EventHandler.off(this._element, EVENT_KEY)
3✔
75
  }
76

77
  // Private
78
  _start(event) {
79
    if (!this._supportPointerEvents) {
14✔
80
      this._deltaX = event.touches[0].clientX
10✔
81

82
      return
10✔
83
    }
84

85
    if (this._eventIsPointerPenTouch(event)) {
4✔
86
      this._deltaX = event.clientX
4✔
87
    }
88
  }
89

90
  _end(event) {
91
    if (this._eventIsPointerPenTouch(event)) {
14✔
92
      this._deltaX = event.clientX - this._deltaX
4✔
93
    }
94

95
    this._handleSwipe()
14✔
96
    execute(this._config.endCallback)
14✔
97
  }
98

99
  _move(event) {
100
    this._deltaX = event.touches && event.touches.length > 1 ?
230✔
101
      0 :
230✔
102
      event.touches[0].clientX - this._deltaX
103
  }
104

105
  _handleSwipe() {
106
    const absDeltaX = Math.abs(this._deltaX)
14✔
107

108
    if (absDeltaX <= SWIPE_THRESHOLD) {
14✔
109
      return
4✔
110
    }
111

112
    const direction = absDeltaX / this._deltaX
10✔
113

114
    this._deltaX = 0
10✔
115

116
    if (!direction) {
10!
117
      return
×
118
    }
119

120
    execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback)
10✔
121
  }
122

123
  _initEvents() {
124
    if (this._supportPointerEvents) {
26✔
125
      EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event))
19✔
126
      EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event))
19✔
127

128
      this._element.classList.add(CLASS_NAME_POINTER_EVENT)
19✔
129
    } else {
130
      EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event))
10✔
131
      EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event))
230✔
132
      EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event))
10✔
133
    }
134
  }
135

136
  _eventIsPointerPenTouch(event) {
137
    return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)
18✔
138
  }
139

140
  // Static
141
  static isSupported() {
142
    return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0
88✔
143
  }
144
}
145

146
export default Swipe
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc