wheel-gestures
Advanced tools
Comparing version 2.2.3 to 2.2.4
{ | ||
"name": "wheel-gestures", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "wheel gestures and momentum detection", | ||
@@ -19,3 +19,5 @@ "main": "dist/index.js", | ||
"test": "tsdx test", | ||
"lint": "tsdx lint", | ||
"lint": "tsdx lint src docs && yarn type-check", | ||
"lint:fix": "tsdx lint src docs --fix", | ||
"type-check": "tsc --noEmit", | ||
"prepare": "tsdx build", | ||
@@ -57,3 +59,3 @@ "semantic-release": "semantic-release" | ||
"eslint-plugin-import": "^2.19.1", | ||
"eslint-plugin-simple-import-sort": "^5.0.0", | ||
"eslint-plugin-simple-import-sort": "^7.0.0", | ||
"eslint-plugin-react": "^7.14.3", | ||
@@ -63,3 +65,3 @@ "eslint-plugin-react-app": "^6.2.2", | ||
"lint-staged": "^10.1.6", | ||
"semantic-release": "^17.0.4", | ||
"semantic-release": "^17.4.2", | ||
"tsdx": "^0.14.1", | ||
@@ -66,0 +68,0 @@ "tslib": "^2.0.0", |
@@ -8,3 +8,3 @@ import { deepFreeze } from '../utils' | ||
export default function EventBus<EventMap = EventMapEmpty>() { | ||
const listeners = {} as Record<keyof EventMap, EventListener<any>[]> | ||
const listeners = {} as Record<keyof EventMap, EventListener<never>[]> | ||
@@ -22,3 +22,3 @@ function on<EK extends keyof EventMap>(type: EK, listener: EventListener<EventMap[EK]>): Off { | ||
if (!(type in listeners)) return | ||
listeners[type].forEach((l) => l(data)) | ||
;(listeners[type] as EventListener<EventMap[EK]>[]).forEach((l) => l(data)) | ||
} | ||
@@ -25,0 +25,0 @@ |
@@ -0,4 +1,4 @@ | ||
import * as WheelGestureExports from '../../index' | ||
test('exports', () => { | ||
const WheelGestureExports = require('../../index') | ||
expect(WheelGestureExports.default.name).toEqual('WheelGestures') | ||
@@ -5,0 +5,0 @@ |
@@ -7,4 +7,4 @@ import doubleSwipeRight from '../fixtures/double-swipe-right.json' | ||
import swipeLeft from '../fixtures/swipe-left-trackpad.json' | ||
import swipeRight from '../fixtures/swipe-right.json' | ||
import swipeRightFast from '../fixtures/swipe-right-fast.json' | ||
import swipeRight from '../fixtures/swipe-right.json' | ||
import swipeUpFast from '../fixtures/swipe-up-fast-trackpad.json' | ||
@@ -11,0 +11,0 @@ import swipeUp from '../fixtures/swipe-up-trackpad.json' |
@@ -110,3 +110,3 @@ import { WheelEventData, WheelGesturesOptions } from '../../types' | ||
testPreventWheelActionWithOptions(swipeUpTrackpad.wheelEvents, { | ||
// @ts-ignore | ||
// @ts-expect-error | ||
options: { preventWheelAction: 'xyz' }, | ||
@@ -113,0 +113,0 @@ }) |
@@ -11,3 +11,5 @@ import { WheelEventData } from '../../types' | ||
const firstMomentumStateWithMomentum = allPhaseData.find((data) => data.isMomentum)! | ||
const firstMomentumStateWithMomentum = allPhaseData.find((data) => data.isMomentum) | ||
if (!firstMomentumStateWithMomentum) throw new Error('missing firstMomentumStateWithMomentum') | ||
const lastState = lastOf(allPhaseData) | ||
@@ -14,0 +16,0 @@ |
@@ -48,6 +48,6 @@ import { WheelGestures } from '../..' | ||
it('should work with new', function() { | ||
// @ts-ignore | ||
// @ts-expect-error | ||
const wG = new WheelGestures() | ||
const callback = jest.fn() | ||
expect(wG.on(callback)) | ||
expect(typeof wG.on(callback)).toEqual('function') | ||
}) | ||
@@ -54,0 +54,0 @@ }) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
356577
11463