diff --git a/.eslintrc.js b/.eslintrc.js index 40886920..33923eff 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,7 @@ module.exports = { parser: '@typescript-eslint/parser', parserOptions: { - project: './tsconfig.json', + project: './tsconfig.all.json', }, extends: [ 'eslint:recommended', diff --git a/src/__tests__/__snapshots__/useSwipeable.spec.js.snap b/__tests__/__snapshots__/useSwipeable.spec.tsx.snap similarity index 100% rename from src/__tests__/__snapshots__/useSwipeable.spec.js.snap rename to __tests__/__snapshots__/useSwipeable.spec.tsx.snap diff --git a/__tests__/helpers/index.ts b/__tests__/helpers/index.ts new file mode 100644 index 00000000..e9de7b58 --- /dev/null +++ b/__tests__/helpers/index.ts @@ -0,0 +1,19 @@ +import {MockedSwipeFunctions} from '../useSwipeable.spec'; + +const expectSwipingDir = (fns: jest.Mock, dir: string) => { + fns.mock.calls.forEach((call) => { + expect(call[0].dir).toBe(dir); + }); +}; + +export const expectSwipeFuncsDir = (sf: MockedSwipeFunctions, dir: string): void => { + Object.keys(sf).forEach((s) => { + if (s.endsWith(dir) || s === "onSwiped") { + expect(sf[s as keyof MockedSwipeFunctions]).toHaveBeenCalled(); + } else if (s === "onSwiping") { + expectSwipingDir(sf[s], dir); + } else { + expect(sf[s as keyof MockedSwipeFunctions]).not.toHaveBeenCalled(); + } + }); +} diff --git a/src/__tests__/useSwipeable.spec.js b/__tests__/useSwipeable.spec.tsx similarity index 92% rename from src/__tests__/useSwipeable.spec.js rename to __tests__/useSwipeable.spec.tsx index 2d243445..9f79b56d 100644 --- a/src/__tests__/useSwipeable.spec.js +++ b/__tests__/useSwipeable.spec.tsx @@ -1,18 +1,31 @@ -/* global document, jest, expect, beforeAll */ -import React from "react"; +import * as React from "react"; import { render, fireEvent, act } from "@testing-library/react"; -import { useSwipeable, LEFT, RIGHT, UP, DOWN } from "../index"; +import { useSwipeable, LEFT, RIGHT, UP, DOWN } from "../src/index"; import { expectSwipeFuncsDir } from "./helpers"; -const DIRECTIONS = [LEFT, RIGHT, UP, DOWN]; - -function getMockedSwipeFunctions() { +const DIRECTIONS: [typeof LEFT, typeof RIGHT, typeof UP, typeof DOWN] = [ + LEFT, + RIGHT, + UP, + DOWN, +]; + +export type MockedSwipeFunctions = { + onSwiping: jest.Mock; + onSwiped: jest.Mock; + onSwipedLeft: jest.Mock; + onSwipedRight: jest.Mock; + onSwipedUp: jest.Mock; + onSwipedDown: jest.Mock; +}; +function getMockedSwipeFunctions(): MockedSwipeFunctions { + const onSwiped = "onSwiped"; return DIRECTIONS.reduce( - (acc, dir) => ({ ...acc, [`onSwiped${dir}`]: jest.fn() }), + (acc, dir) => ({ ...acc, [onSwiped + dir]: jest.fn() }), { onSwiping: jest.fn(), onSwiped: jest.fn(), - } + } as MockedSwipeFunctions ); } @@ -22,7 +35,7 @@ const TESTING_TEXT = "touch here"; */ function SwipeableUsingHook({ nodeName = "div", ...rest }) { const eventHandlers = useSwipeable(rest); - const Elem = nodeName; + const Elem = nodeName as React.ElementType; return ( {TESTING_TEXT} @@ -37,11 +50,18 @@ const TS = "touchStart"; const TM = "touchMove"; const TE = "touchEnd"; -const createClientXYObject = (x, y) => ({ clientX: x, clientY: y }); +const createClientXYObject = (x?: number, y?: number) => ({ + clientX: x, + clientY: y, +}); // Create touch event -const cte = ({ x, y }) => ({ touches: [createClientXYObject(x, y)] }); +const cte = ({ x, y }: { x?: number; y?: number }) => ({ + touches: [createClientXYObject(x, y)], +}); // Create Mouse Event -const cme = ({ x, y }) => ({ ...createClientXYObject(x, y) }); +const cme = ({ x, y }: { x?: number; y?: number }) => ({ + ...createClientXYObject(x, y), +}); describe("useSwipeable", () => { let defaultPrevented = 0; @@ -336,7 +356,9 @@ describe("useSwipeable", () => { expect(swipeFuncs.onSwiping).toHaveBeenCalledTimes(8); [LEFT, UP, DOWN].forEach((dir) => { - expect(swipeFuncs[`onSwiped${dir}`]).not.toHaveBeenCalled(); + expect( + swipeFuncs[`onSwiped${dir}` as keyof MockedSwipeFunctions] + ).not.toHaveBeenCalled(); }); }); @@ -397,10 +419,10 @@ describe("useSwipeable", () => { expect(onSwipedDown).toHaveBeenCalledTimes(2); }); - it(`handles new prop swipe callbacks from rerenders`, () => { + it(`handles new prop swipe callbacks from re-renders`, () => { const onSwipedSpy = jest.fn(); - function TestHookComponent({ next }) { + function TestHookComponent({ next }: { next: () => void }) { const handlers = useSwipeable({ onSwiped: next }); return
{TESTING_TEXT}
; } diff --git a/package.json b/package.json index 3a69b3fe..20769855 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,15 @@ "jsnext:main": "./dist/react-swipeable.modern.js", "module": "./dist/react-swipeable.module.js", "source": "./src/index.ts", + "types": "./dist/index.d.ts", + "typings": "./dist/index.d.ts", "scripts": { "build": "microbundle --no-compress --name swipeable --output dist", "build:examples": "webpack -p --config ./examples/webpack.config.min.js", "build:publish:examples": "npm run build:examples && rimraf examples/node_modules && gh-pages -d examples", "clean": "rimraf dist", - "format": "prettier --write src/", - "lint": "eslint .", + "format": "prettier --write src __tests__", + "lint": "eslint . --ext .ts,.tsx", "prebuild": "npm run clean", "prepare": "npm run build", "pretest": "npm run lint", @@ -32,10 +34,9 @@ } ], "jest": { - "testPathIgnorePatterns": [ - "/node_modules/", - "/types/", - "/__tests__/helpers/" + "preset": "ts-jest", + "testMatch": [ + "/__tests__/**/*.(test|spec).ts?(x)" ] }, "keywords": [ @@ -68,14 +69,16 @@ "types/index.d.ts" ], "license": "MIT", - "types": "types", "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.2.0", "@babel/plugin-proposal-object-rest-spread": "^7.2.0", "@babel/preset-env": "^7.2.0", "@babel/preset-react": "^7.10.4", "@testing-library/react": "^10.4.3", + "@types/jest": "^26.0.4", "@types/react": "^16.8.12", + "@typescript-eslint/eslint-plugin": "^3.6.1", + "@typescript-eslint/parser": "^3.6.1", "babel-jest": "^26.1.0", "babel-loader": "^8.0.5", "coveralls": "^3.0.3", @@ -94,11 +97,13 @@ "rollup": "^1.1.2", "rollup-plugin-babel": "^4.3.2", "size-limit": "^1.3.5", + "ts-jest": "^26.1.2", "typescript": "^3.9.6", "webpack": "^4.29.0", "webpack-cli": "^3.2.1", "webpack-dev-server": "^3.1.14" }, + "dependencies": {}, "peerDependencies": { "react": ">= 16.8.0" } diff --git a/src/__tests__/helpers/index.js b/src/__tests__/helpers/index.js deleted file mode 100644 index 79fac421..00000000 --- a/src/__tests__/helpers/index.js +++ /dev/null @@ -1,17 +0,0 @@ -/* global expect */ -const expectSwipingDir = (fns, dir) => { - fns.mock.calls.forEach((call) => { - expect(call[0].dir).toBe(dir); - }); -}; - -export const expectSwipeFuncsDir = (sf, dir) => - Object.keys(sf).forEach((s) => { - if (s.endsWith(dir) || s === "onSwiped") { - expect(sf[s]).toHaveBeenCalled(); - } else if (s === "onSwiping") { - expectSwipingDir(sf[s], dir); - } else { - expect(sf[s]).not.toHaveBeenCalled(); - } - }); diff --git a/src/index.ts b/src/index.ts index 1e00ce0c..f7a67baa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ /* global document */ import * as React from "react"; -export type HandledEvents = MouseEvent | TouchEvent; +export type HandledEvents = React.MouseEvent | TouchEvent | MouseEvent; export type Vector2 = [number, number]; export type EventData = { event: HandledEvents; @@ -36,7 +36,7 @@ export interface SwipeableOptions { export interface SwipeableHandlers { ref(element: HTMLElement | null): void; - onMouseDown?(event: HandledEvents): void; + onMouseDown?(event: React.MouseEvent): void; } type StateEventData = { @@ -137,13 +137,13 @@ function getHandlers( ): [ { ref: (element: HTMLElement | null) => void; - onMouseDown?: (event: HandledEvents) => void; + onMouseDown?: (event: React.MouseEvent) => void; }, (el: any) => (() => void) | undefined ] { const onStart = (event: HandledEvents) => { // if more than a single touch don't track, for now... - if (event && ('touches' in event) && event.touches.length > 1) return; + if (event && "touches" in event && event.touches.length > 1) return; set((state, props) => { // setup mouse listeners on document to track swipe since swipe can leave container @@ -151,7 +151,8 @@ function getHandlers( document.addEventListener(mouseMove, onMove); document.addEventListener(mouseUp, onUp); } - const { clientX, clientY } = ('touches' in event) ? event.touches[0] : event; + const { clientX, clientY } = + "touches" in event ? event.touches[0] : event; const xy = rotateXYByAngle([clientX, clientY], props.rotationAngle); return { ...state, @@ -168,11 +169,12 @@ function getHandlers( if ( !state.xy[0] || !state.xy[1] || - (('touches' in event) && event.touches.length > 1) + ("touches" in event && event.touches.length > 1) ) { return state; } - const { clientX, clientY } = ('touches' in event) ? event.touches[0] : event; + const { clientX, clientY } = + "touches" in event ? event.touches[0] : event; const [x, y] = rotateXYByAngle([clientX, clientY], props.rotationAngle); const deltaX = state.xy[0] - x; const deltaY = state.xy[1] - y; @@ -202,7 +204,7 @@ function getHandlers( // track if a swipe is cancelable(handler for swiping or swiped(dir) exists) // so we can call preventDefault if needed let cancelablePageSwipe = false; - if (props.onSwiping || props.onSwiped || (`onSwiped${dir}` in props)) { + if (props.onSwiping || props.onSwiped || `onSwiped${dir}` in props) { cancelablePageSwipe = true; } @@ -232,7 +234,7 @@ function getHandlers( props.onSwiped && props.onSwiped(eventData); const onSwipedDir = `onSwiped${eventData.dir}`; - if ((onSwipedDir in props)) { + if (onSwipedDir in props) { (props as any)[onSwipedDir](eventData); } } @@ -254,7 +256,10 @@ function getHandlers( const attachTouch = (el: HTMLElement) => { if (el && el.addEventListener) { // attach touch event listeners and handlers - const tls: [typeof touchStart | typeof touchMove | typeof touchEnd, (e: HandledEvents) => void][] = [ + const tls: [ + typeof touchStart | typeof touchMove | typeof touchEnd, + (e: HandledEvents) => void + ][] = [ [touchStart, onStart], [touchMove, onMove], [touchEnd, onEnd], @@ -273,7 +278,7 @@ function getHandlers( // if the same DOM el as previous just return state if (state.el === el) return state; - let addState: { cleanUpTouch?: (() => void) | null } = {}; + const addState: { cleanUpTouch?: (() => void) | null } = {}; // if new DOM el clean up old DOM and reset cleanUpTouch if (state.el && state.el !== el && state.cleanUpTouch) { state.cleanUpTouch(); @@ -290,7 +295,9 @@ function getHandlers( }; // set ref callback to attach touch event listeners - const output: { ref: typeof onRef, onMouseDown?: typeof onStart} = { ref: onRef }; + const output: { ref: typeof onRef; onMouseDown?: typeof onStart } = { + ref: onRef, + }; // if track mouse attach mouse down listener if (handlerProps.trackMouse) { @@ -305,7 +312,7 @@ function updateTransientState( props: Props, attachTouch: (el: any) => (() => void) | undefined ) { - let addState: { cleanUpTouch?(): void } = {}; + const addState: { cleanUpTouch?(): void } = {}; // clean up touch handlers if no longer tracking touches if (!props.trackTouch && state.cleanUpTouch) { state.cleanUpTouch(); diff --git a/tsconfig.all.json b/tsconfig.all.json new file mode 100644 index 00000000..e7ee30b2 --- /dev/null +++ b/tsconfig.all.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.base.json", + "include": ["src/**/*", "__tests__"], + } diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000..1f7cea10 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "allowJs": true, + "baseUrl": ".", + "esModuleInterop": true, + "jsx": "react", + "lib": ["ESNext", "dom"], + "module": "ESNext", + "moduleResolution": "node", + "noImplicitAny": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "lib/", + "pretty": true, + "rootDirs": ["./src", "./stories"], + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "target": "ESNext" + } +} diff --git a/tsconfig.json b/tsconfig.json index 5acba3e3..8bb85fb0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,4 @@ { - "compilerOptions": { - "allowJs": true, - "baseUrl": ".", - "esModuleInterop": true, - "jsx": "react", - "lib": ["esnext", "dom"], - "module": "es2015", - "moduleResolution": "node", - "noImplicitAny": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "outDir": "lib/", - "pretty": true, - "rootDirs": ["./src", "./stories"], - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "target": "esnext" - }, + "extends": "./tsconfig.base.json", "include": ["src/**/*"], - "exclude": ["examples/**/*"] -} + } diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 00000000..52e9e1a7 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.base.json", + "include": ["__tests__"], + } diff --git a/yarn.lock b/yarn.lock index a599f40d..0f1bbad9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1293,6 +1293,11 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/estree@*": version "0.0.45" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884" @@ -1338,7 +1343,15 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" -"@types/json-schema@^7.0.4": +"@types/jest@^26.0.4": + version "26.0.4" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.4.tgz#d2e513e85aca16992816f192582b5e67b0b15efb" + integrity sha512-4fQNItvelbNA9+sFgU+fhJo8ZFF+AS4Egk3GWwCW2jFtViukXbnztccafAdLhzE/0EiCogljtQQXP8aQ9J7sFg== + dependencies: + jest-diff "^25.2.1" + pretty-format "^25.2.1" + +"@types/json-schema@^7.0.3", "@types/json-schema@^7.0.4": version "7.0.5" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ== @@ -1410,6 +1423,66 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/eslint-plugin@^3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.1.tgz#5ced8fd2087fbb83a76973dea4a0d39d9cb4a642" + integrity sha512-06lfjo76naNeOMDl+mWG9Fh/a0UHKLGhin+mGaIw72FUMbMGBkdi/FEJmgEDzh4eE73KIYzHWvOCYJ0ak7nrJQ== + dependencies: + "@typescript-eslint/experimental-utils" "3.6.1" + debug "^4.1.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.1.tgz#b5a2738ebbceb3fa90c5b07d50bb1225403c4a54" + integrity sha512-oS+hihzQE5M84ewXrTlVx7eTgc52eu+sVmG7ayLfOhyZmJ8Unvf3osyFQNADHP26yoThFfbxcibbO0d2FjnYhg== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/types" "3.6.1" + "@typescript-eslint/typescript-estree" "3.6.1" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + +"@typescript-eslint/parser@^3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.6.1.tgz#216e8adf4ee9c629f77c985476a2ea07fb80e1dc" + integrity sha512-SLihQU8RMe77YJ/jGTqOt0lMq7k3hlPVfp7v/cxMnXA9T0bQYoMDfTsNgHXpwSJM1Iq2aAJ8WqekxUwGv5F67Q== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "3.6.1" + "@typescript-eslint/types" "3.6.1" + "@typescript-eslint/typescript-estree" "3.6.1" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/types@3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.6.1.tgz#87600fe79a1874235d3cc1cf5c7e1a12eea69eee" + integrity sha512-NPxd5yXG63gx57WDTW1rp0cF3XlNuuFFB5G+Kc48zZ+51ZnQn9yjDEsjTPQ+aWM+V+Z0I4kuTFKjKvgcT1F7xQ== + +"@typescript-eslint/typescript-estree@3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.1.tgz#a5c91fcc5497cce7922ff86bc37d5e5891dcdefa" + integrity sha512-G4XRe/ZbCZkL1fy09DPN3U0mR6SayIv1zSeBNquRFRk7CnVLgkC2ZPj8llEMJg5Y8dJ3T76SvTGtceytniaztQ== + dependencies: + "@typescript-eslint/types" "3.6.1" + "@typescript-eslint/visitor-keys" "3.6.1" + debug "^4.1.1" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/visitor-keys@3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.1.tgz#5c57a7772f4dd623cfeacc219303e7d46f963b37" + integrity sha512-qC8Olwz5ZyMTZrh4Wl3K4U6tfms0R/mzU4/5W3XeUZptVraGVmbptJbn6h2Ey6Rb3hOs3zWoAUebZk8t47KGiQ== + dependencies: + eslint-visitor-keys "^1.1.0" + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -2238,6 +2311,13 @@ browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.8.5: escalade "^3.0.1" node-releases "^1.1.58" +bs-logger@0.x: + version "0.2.6" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== + dependencies: + fast-json-stable-stringify "2.x" + bser@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -2250,7 +2330,7 @@ buffer-crc32@~0.2.3: resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= -buffer-from@^1.0.0: +buffer-from@1.x, buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== @@ -3274,6 +3354,11 @@ detect-passive-events@^1.0.0: resolved "https://registry.yarnpkg.com/detect-passive-events/-/detect-passive-events-1.0.4.tgz#6ed477e6e5bceb79079735dcd357789d37f9a91a" integrity sha1-btR35uW863kHlzXc01d4nTf5qRo= +diff-sequences@^25.2.6: + version "25.2.6" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" + integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== + diff-sequences@^26.0.0: version "26.0.0" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.0.0.tgz#0760059a5c287637b842bd7085311db7060e88a6" @@ -3609,7 +3694,7 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^5.1.0: +eslint-scope@^5.0.0, eslint-scope@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w== @@ -3941,7 +4026,7 @@ fast-glob@^3.0.3: micromatch "^4.0.2" picomatch "^2.2.1" -fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -4344,7 +4429,7 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" -glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: +glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -5357,6 +5442,16 @@ jest-config@^26.1.0: micromatch "^4.0.2" pretty-format "^26.1.0" +jest-diff@^25.2.1: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.5.0.tgz#1dd26ed64f96667c068cef026b677dfa01afcfa9" + integrity sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A== + dependencies: + chalk "^3.0.0" + diff-sequences "^25.2.6" + jest-get-type "^25.2.6" + pretty-format "^25.5.0" + jest-diff@^26.1.0: version "26.1.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.1.0.tgz#00a549bdc936c9691eb4dc25d1fbd78bf456abb2" @@ -5408,6 +5503,11 @@ jest-environment-node@^26.1.0: jest-mock "^26.1.0" jest-util "^26.1.0" +jest-get-type@^25.2.6: + version "25.2.6" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" + integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== + jest-get-type@^26.0.0: version "26.0.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.0.0.tgz#381e986a718998dbfafcd5ec05934be538db4039" @@ -5613,7 +5713,7 @@ jest-snapshot@^26.1.0: pretty-format "^26.1.0" semver "^7.3.2" -jest-util@^26.1.0: +jest-util@26.x, jest-util@^26.1.0: version "26.1.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.1.0.tgz#80e85d4ba820decacf41a691c2042d5276e5d8d8" integrity sha512-rNMOwFQevljfNGvbzNQAxdmXQ+NawW/J72dmddsK0E8vgxXCMtwQ/EH0BiWEIxh0hhMcTsxwAxINt7Lh46Uzbg== @@ -5763,6 +5863,13 @@ json3@^3.3.2: resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81" integrity sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA== +json5@2.x, json5@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" + integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== + dependencies: + minimist "^1.2.5" + json5@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" @@ -5770,13 +5877,6 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" - integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== - dependencies: - minimist "^1.2.5" - jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -5916,7 +6016,7 @@ lodash.camelcase@^4.3.0: resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= -lodash.memoize@^4.1.2: +lodash.memoize@4.x, lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= @@ -5994,6 +6094,11 @@ make-dir@^3.0.0, make-dir@^3.0.2: dependencies: semver "^6.0.0" +make-error@1.x: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" @@ -6266,6 +6371,11 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" +mkdirp@1.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" @@ -7395,7 +7505,7 @@ pretty-bytes@^5.3.0: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.3.0.tgz#f2849e27db79fb4d6cfe24764fc4134f165989f2" integrity sha512-hjGrh+P926p4R4WbaB6OckyRtO0F0/lQBiT+0gnxjV+5kjPBrfVBFCsCLbMqVQeydvIoouYTCmmEURiH3R1Bdg== -pretty-format@^25.5.0: +pretty-format@^25.2.1, pretty-format@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a" integrity sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ== @@ -7764,7 +7874,7 @@ regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.3.0: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" -regexpp@^3.1.0: +regexpp@^3.0.0, regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== @@ -8197,16 +8307,16 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== +semver@7.x, semver@^7.2.1, semver@^7.3.2: + version "7.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" + integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + semver@^6.0.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.2: - version "7.3.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" - integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== - send@0.17.1: version "0.17.1" resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" @@ -9065,16 +9175,39 @@ tryer@^1.0.1: resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== +ts-jest@^26.1.2: + version "26.1.2" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.1.2.tgz#dd2e832ffae9cb803361483b6a3010a6413dc475" + integrity sha512-V4SyBDO9gOdEh+AF4KtXJeP+EeI4PkOrxcA8ptl4o8nCXUVM5Gg/8ngGKneS5BsZaR9DXVQNqj9k+iqGAnpGow== + dependencies: + bs-logger "0.x" + buffer-from "1.x" + fast-json-stable-stringify "2.x" + jest-util "26.x" + json5 "2.x" + lodash.memoize "4.x" + make-error "1.x" + mkdirp "1.x" + semver "7.x" + yargs-parser "18.x" + tslib@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== -tslib@^1.13.0, tslib@^1.9.0: +tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: version "1.13.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== +tsutils@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -9728,6 +9861,14 @@ yaml@^1.7.2: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e" integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg== +yargs-parser@18.x, yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" @@ -9744,14 +9885,6 @@ yargs-parser@^15.0.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs@^13.3.0, yargs@^13.3.2: version "13.3.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"