@axe-core/watcher 3.11.0 → 3.11.1-next.06e682d4
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/dist/Controller.d.ts +9 -1
- package/dist/Controller.js +24 -10
- package/dist/Controller.js.map +1 -1
- package/dist/EventForwarder.js +4 -6
- package/dist/EventForwarder.js.map +1 -1
- package/dist/createDebugger.d.ts +9 -0
- package/dist/createDebugger.js +27 -0
- package/dist/createDebugger.js.map +1 -0
- package/dist/cypress.d.ts +1 -1
- package/dist/cypress.js +30 -20
- package/dist/cypress.js.map +1 -1
- package/dist/cypressCommands.d.ts +3 -1
- package/dist/cypressCommands.js +78 -39
- package/dist/cypressCommands.js.map +1 -1
- package/dist/git.d.ts +2 -1
- package/dist/git.js +5 -4
- package/dist/git.js.map +1 -1
- package/dist/playwright.d.ts +1 -1
- package/dist/playwright.js +10 -7
- package/dist/playwright.js.map +1 -1
- package/dist/playwrightTest.js +10 -4
- package/dist/playwrightTest.js.map +1 -1
- package/dist/playwrightWrapping.d.ts +1 -1
- package/dist/playwrightWrapping.js +41 -41
- package/dist/playwrightWrapping.js.map +1 -1
- package/dist/puppeteer.d.ts +1 -1
- package/dist/puppeteer.js +11 -8
- package/dist/puppeteer.js.map +1 -1
- package/dist/puppeteerWrapping.d.ts +3 -2
- package/dist/puppeteerWrapping.js +100 -42
- package/dist/puppeteerWrapping.js.map +1 -1
- package/dist/sendResultsToServer.d.ts +9 -2
- package/dist/sendResultsToServer.js +25 -43
- package/dist/sendResultsToServer.js.map +1 -1
- package/dist/utils/constants.d.ts +4 -0
- package/dist/utils/constants.js +16 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/headlessNotSupportedError.d.ts +5 -0
- package/dist/utils/headlessNotSupportedError.js +17 -0
- package/dist/utils/headlessNotSupportedError.js.map +1 -0
- package/dist/utils/headlessNotSupportedError.test.d.ts +1 -0
- package/dist/utils/headlessNotSupportedError.test.js +21 -0
- package/dist/utils/headlessNotSupportedError.test.js.map +1 -0
- package/dist/utils/mergeChromeArgs.d.ts +12 -0
- package/dist/utils/mergeChromeArgs.js +73 -0
- package/dist/utils/mergeChromeArgs.js.map +1 -0
- package/dist/utils/mergeChromeArgs.test.d.ts +1 -0
- package/dist/utils/mergeChromeArgs.test.js +260 -0
- package/dist/utils/mergeChromeArgs.test.js.map +1 -0
- package/dist/utils/proxyHandlers.d.ts +12 -0
- package/dist/utils/proxyHandlers.js +62 -0
- package/dist/utils/proxyHandlers.js.map +1 -0
- package/dist/utils/proxyHandlers.test.d.ts +1 -0
- package/dist/utils/proxyHandlers.test.js +28 -0
- package/dist/utils/proxyHandlers.test.js.map +1 -0
- package/dist/utils/readVariables.d.ts +7 -0
- package/dist/utils/readVariables.js +17 -0
- package/dist/utils/readVariables.js.map +1 -0
- package/dist/utils/updateAutoAnalyze.d.ts +7 -0
- package/dist/utils/updateAutoAnalyze.js +20 -0
- package/dist/utils/updateAutoAnalyze.js.map +1 -0
- package/dist/utils/validateApiKey.d.ts +7 -0
- package/dist/utils/validateApiKey.js +34 -0
- package/dist/utils/validateApiKey.js.map +1 -0
- package/dist/utils/validateApiKey.test.d.ts +1 -0
- package/dist/utils/validateApiKey.test.js +66 -0
- package/dist/utils/validateApiKey.test.js.map +1 -0
- package/dist/utils/validateAxeRunContext.d.ts +2 -0
- package/dist/utils/validateAxeRunContext.js +59 -0
- package/dist/utils/validateAxeRunContext.js.map +1 -0
- package/dist/utils/validateAxeRunContext.test.d.ts +1 -0
- package/dist/utils/validateAxeRunContext.test.js +100 -0
- package/dist/utils/validateAxeRunContext.test.js.map +1 -0
- package/dist/utils/validateAxeRunOptions.d.ts +13 -0
- package/dist/utils/validateAxeRunOptions.js +161 -0
- package/dist/utils/validateAxeRunOptions.js.map +1 -0
- package/dist/utils/validateAxeRunOptions.test.d.ts +1 -0
- package/dist/utils/validateAxeRunOptions.test.js +230 -0
- package/dist/utils/validateAxeRunOptions.test.js.map +1 -0
- package/dist/utils/writeExtensionManifest.d.ts +7 -0
- package/dist/utils/writeExtensionManifest.js +18 -0
- package/dist/utils/writeExtensionManifest.js.map +1 -0
- package/dist/utils/writeVariables.d.ts +64 -0
- package/dist/utils/writeVariables.js +119 -0
- package/dist/utils/writeVariables.js.map +1 -0
- package/dist/utils/writeVariables.test.d.ts +1 -0
- package/dist/utils/writeVariables.test.js +184 -0
- package/dist/utils/writeVariables.test.js.map +1 -0
- package/dist/wdio.d.ts +1 -1
- package/dist/wdio.js +18 -13
- package/dist/wdio.js.map +1 -1
- package/dist/webdriver.d.ts +1 -1
- package/dist/webdriver.js +15 -8
- package/dist/webdriver.js.map +1 -1
- package/dist/webdriverWrapping.d.ts +1 -1
- package/dist/webdriverWrapping.js +16 -16
- package/dist/webdriverWrapping.js.map +1 -1
- package/extension/background.js +1 -1
- package/extension/content.js +1 -1
- package/package.json +11 -8
- package/dist/util.d.ts +0 -66
- package/dist/util.js +0 -167
- package/dist/util.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axe-core/watcher",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.1-next.06e682d4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
13
|
-
"test": "mocha 'src
|
|
13
|
+
"test": "mocha 'src/**/*.test.ts'",
|
|
14
14
|
"test:e2e": "mocha 'e2e/*.test.ts'",
|
|
15
15
|
"serve:e2e": "ts-node e2e/Server.ts",
|
|
16
16
|
"coverage": "nyc npm test",
|
|
@@ -18,17 +18,19 @@
|
|
|
18
18
|
"dev": "tsc -w"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"debug": "^4.3.5",
|
|
21
22
|
"eventemitter3": "^5.0.1",
|
|
22
23
|
"node-fetch": "^2.6.7",
|
|
23
24
|
"sync-request": "^6.1.0",
|
|
24
|
-
"uuid": "^
|
|
25
|
+
"uuid": "^10.0.0"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"@deque/advanced-rule-recorder": "^1.
|
|
28
|
-
"@playwright/test": "^1.
|
|
28
|
+
"@deque/advanced-rule-recorder": "^1.16.0-next.db8d9af7",
|
|
29
|
+
"@playwright/test": "^1.45.0",
|
|
29
30
|
"@types/body-parser": "^1.19.2",
|
|
30
31
|
"@types/chai": "^4.3.3",
|
|
31
32
|
"@types/cors": "^2.8.12",
|
|
33
|
+
"@types/debug": "^4.1.12",
|
|
32
34
|
"@types/express": "^4.17.14",
|
|
33
35
|
"@types/mocha": "^10.0.0",
|
|
34
36
|
"@types/morgan": "^1.9.3",
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
"@types/proxyquire": "^1.3.28",
|
|
38
40
|
"@types/selenium-webdriver": "^4.1.15",
|
|
39
41
|
"@types/sinon": "^17.0.3",
|
|
40
|
-
"@types/uuid": "^
|
|
42
|
+
"@types/uuid": "^10.0.0",
|
|
41
43
|
"@wdio/types": "^8.32.4",
|
|
42
44
|
"axe-core": "^4.9.1",
|
|
43
45
|
"axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
|
|
@@ -51,7 +53,8 @@
|
|
|
51
53
|
"mocha": "^10.4.0",
|
|
52
54
|
"morgan": "^1.10.0",
|
|
53
55
|
"nock": "^13.3.2",
|
|
54
|
-
"nyc": "^
|
|
56
|
+
"nyc": "^17.0.0",
|
|
57
|
+
"playwright-core": "^1.45.0",
|
|
55
58
|
"proxyquire": "^2.1.3",
|
|
56
59
|
"puppeteer": "^22.1.0",
|
|
57
60
|
"rimraf": "^5.0.5",
|
|
@@ -62,4 +65,4 @@
|
|
|
62
65
|
"typescript": "^5.1.6",
|
|
63
66
|
"webdriverio": "^8.32.3"
|
|
64
67
|
}
|
|
65
|
-
}
|
|
68
|
+
}
|
package/dist/util.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type Controller from './Controller';
|
|
2
|
-
export declare const PATH_TO_EXTENSION: string;
|
|
3
|
-
export declare const DEFAULT_SERVER_URL = "https://axe.deque.com/";
|
|
4
|
-
export declare const PATH_TO_SESSION_FILE: string;
|
|
5
|
-
export declare const PATH_TO_EXTENSION_VARIABLES: string;
|
|
6
|
-
export declare const extensionArgs: readonly [`--disable-extensions-except=${string}`, `--load-extension=${string}`];
|
|
7
|
-
export declare class HeadlessNotSupportedError extends Error {
|
|
8
|
-
name: string;
|
|
9
|
-
constructor(extendedMessage?: string);
|
|
10
|
-
}
|
|
11
|
-
interface AxeConfiguration {
|
|
12
|
-
/** Your axe API key. */
|
|
13
|
-
apiKey: string;
|
|
14
|
-
/** Custom axe server URL. */
|
|
15
|
-
serverURL?: string;
|
|
16
|
-
/** Your session ID. */
|
|
17
|
-
sessionId?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Whether or not to automatically run axe on the page when loaded and
|
|
20
|
-
* when changes are made.
|
|
21
|
-
*/
|
|
22
|
-
autoAnalyze?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface Configuration {
|
|
25
|
-
axe: AxeConfiguration;
|
|
26
|
-
}
|
|
27
|
-
interface WriteVariablesParams extends AxeConfiguration {
|
|
28
|
-
cypress?: boolean;
|
|
29
|
-
}
|
|
30
|
-
/** variables.json shape. */
|
|
31
|
-
export interface Variables {
|
|
32
|
-
api_key: string;
|
|
33
|
-
server_url: string;
|
|
34
|
-
auto_analyze: boolean;
|
|
35
|
-
session_id?: string;
|
|
36
|
-
cypress: boolean;
|
|
37
|
-
take_screenshots?: boolean;
|
|
38
|
-
experimental_advanced_rules?: boolean;
|
|
39
|
-
}
|
|
40
|
-
/** Write the user's settings to the disk, so the extension can load them. */
|
|
41
|
-
export declare function writeVariables({ apiKey, serverURL, sessionId, autoAnalyze, cypress, takeScreenshots, experimentalAdvancedRules }: WriteVariablesParams): void;
|
|
42
|
-
interface ValidateApiKeyParams {
|
|
43
|
-
apiKey: string;
|
|
44
|
-
serverURL: string;
|
|
45
|
-
}
|
|
46
|
-
/** Validate the given `apiKey`. This method is blocking and should not be called unnecessarily. */
|
|
47
|
-
export declare const validateApiKey: ({ apiKey, serverURL }: ValidateApiKeyParams) => void;
|
|
48
|
-
interface WriteManifestParams {
|
|
49
|
-
all_frames: boolean;
|
|
50
|
-
exclude_globs: string[];
|
|
51
|
-
}
|
|
52
|
-
/** Update the extension manifest file. */
|
|
53
|
-
export declare function writeManifest({ all_frames, exclude_globs }: WriteManifestParams): void;
|
|
54
|
-
export declare const readVariables: () => Variables;
|
|
55
|
-
export declare const updateAutoAnalyze: (val: boolean) => void;
|
|
56
|
-
declare const kWrapped: unique symbol;
|
|
57
|
-
export type PossiblyWrapped<T> = T & {
|
|
58
|
-
[kWrapped]?: boolean;
|
|
59
|
-
};
|
|
60
|
-
/** Is the given object wrapped? */
|
|
61
|
-
export declare const isWrapped: <T>(o: PossiblyWrapped<T> | null) => boolean;
|
|
62
|
-
/** Mark the given object as wrapped. */
|
|
63
|
-
export declare const markAsWrapped: (o: unknown) => void;
|
|
64
|
-
export declare const proxiedGetFuncWithAnalyze: <T>(target: T, prop: keyof T, controller: Controller) => (...args: unknown[]) => Promise<unknown>;
|
|
65
|
-
export declare const proxiedGetWithoutAnalyze: <T>(target: T, prop: keyof T) => unknown;
|
|
66
|
-
export {};
|
package/dist/util.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.proxiedGetWithoutAnalyze = exports.proxiedGetFuncWithAnalyze = exports.markAsWrapped = exports.isWrapped = exports.updateAutoAnalyze = exports.readVariables = exports.writeManifest = exports.validateApiKey = exports.writeVariables = exports.HeadlessNotSupportedError = exports.extensionArgs = exports.PATH_TO_EXTENSION_VARIABLES = exports.PATH_TO_SESSION_FILE = exports.DEFAULT_SERVER_URL = exports.PATH_TO_EXTENSION = void 0;
|
|
7
|
-
const uuid_1 = require("uuid");
|
|
8
|
-
const sync_request_1 = __importDefault(require("sync-request"));
|
|
9
|
-
const assert_1 = __importDefault(require("assert"));
|
|
10
|
-
const fs_1 = __importDefault(require("fs"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const os_1 = __importDefault(require("os"));
|
|
13
|
-
exports.PATH_TO_EXTENSION = path_1.default.join(__dirname, '..', 'extension');
|
|
14
|
-
exports.DEFAULT_SERVER_URL = 'https://axe.deque.com/';
|
|
15
|
-
exports.PATH_TO_SESSION_FILE = path_1.default.join(os_1.default.tmpdir(), 'axe-watcher-session.json');
|
|
16
|
-
exports.PATH_TO_EXTENSION_VARIABLES = path_1.default.join(exports.PATH_TO_EXTENSION, 'variables.json');
|
|
17
|
-
exports.extensionArgs = [
|
|
18
|
-
`--disable-extensions-except=${exports.PATH_TO_EXTENSION}`,
|
|
19
|
-
`--load-extension=${exports.PATH_TO_EXTENSION}`
|
|
20
|
-
];
|
|
21
|
-
class HeadlessNotSupportedError extends Error {
|
|
22
|
-
constructor(extendedMessage) {
|
|
23
|
-
super('@axe-core/watcher does not support Chrome\'s older "--headless" mode. ' +
|
|
24
|
-
'Use either "--headless=new" or a headful browser.' +
|
|
25
|
-
(extendedMessage ? ` ${extendedMessage}` : ''));
|
|
26
|
-
this.name = 'HeadlessNotSupportedError';
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.HeadlessNotSupportedError = HeadlessNotSupportedError;
|
|
30
|
-
/** Write the user's settings to the disk, so the extension can load them. */
|
|
31
|
-
function writeVariables({ apiKey, serverURL, sessionId, autoAnalyze, cypress,
|
|
32
|
-
// @ts-expect-error Feature flag, not part of public type
|
|
33
|
-
takeScreenshots,
|
|
34
|
-
// @ts-expect-error Feature flag, not part of public type
|
|
35
|
-
experimentalAdvancedRules }) {
|
|
36
|
-
if (!serverURL) {
|
|
37
|
-
serverURL = exports.DEFAULT_SERVER_URL;
|
|
38
|
-
}
|
|
39
|
-
let urlString;
|
|
40
|
-
try {
|
|
41
|
-
urlString = new URL(serverURL).toString();
|
|
42
|
-
}
|
|
43
|
-
catch (err) {
|
|
44
|
-
throw new Error(`Error when converting serverURL to URL. Ensure it is formatted properly: ${err}`);
|
|
45
|
-
}
|
|
46
|
-
(0, exports.validateApiKey)({ apiKey, serverURL: urlString });
|
|
47
|
-
if (typeof autoAnalyze === 'undefined') {
|
|
48
|
-
autoAnalyze = true;
|
|
49
|
-
}
|
|
50
|
-
// When a custom session ID is not provided, attempt to read it from the filesystem.
|
|
51
|
-
// This enables multi-process/multi-browser test suites to all use the same session ID.
|
|
52
|
-
if (!sessionId && fs_1.default.existsSync(exports.PATH_TO_SESSION_FILE)) {
|
|
53
|
-
try {
|
|
54
|
-
const data = JSON.parse(fs_1.default.readFileSync(exports.PATH_TO_SESSION_FILE, 'utf8'));
|
|
55
|
-
sessionId = data.id;
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
throw new Error(`Unable to read session configuration: ${error}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const variables = {
|
|
62
|
-
api_key: apiKey,
|
|
63
|
-
server_url: urlString,
|
|
64
|
-
/* Ensure only one session ID is created per test run if `sessionId` is not provided */
|
|
65
|
-
session_id: sessionId || (0, uuid_1.v4)(),
|
|
66
|
-
take_screenshots: !!takeScreenshots,
|
|
67
|
-
auto_analyze: !!autoAnalyze,
|
|
68
|
-
cypress: !!cypress,
|
|
69
|
-
experimental_advanced_rules: !!experimentalAdvancedRules
|
|
70
|
-
};
|
|
71
|
-
fs_1.default.writeFileSync(exports.PATH_TO_EXTENSION_VARIABLES, JSON.stringify(variables));
|
|
72
|
-
}
|
|
73
|
-
exports.writeVariables = writeVariables;
|
|
74
|
-
/** Validate the given `apiKey`. This method is blocking and should not be called unnecessarily. */
|
|
75
|
-
const validateApiKey = ({ apiKey, serverURL }) => {
|
|
76
|
-
(0, assert_1.default)(apiKey, 'API key is required');
|
|
77
|
-
const url = new URL(`/api/api-keys/${apiKey}/validate/axe-devtools-watcher`, serverURL);
|
|
78
|
-
const res = (0, sync_request_1.default)('GET', url.toString(), {
|
|
79
|
-
maxRedirects: 2,
|
|
80
|
-
followRedirects: true,
|
|
81
|
-
maxRetries: 2,
|
|
82
|
-
retry: true,
|
|
83
|
-
retryDelay: 100
|
|
84
|
-
});
|
|
85
|
-
const body = JSON.parse(res.getBody('utf8'));
|
|
86
|
-
if (body.error) {
|
|
87
|
-
throw new Error(body.error);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
exports.validateApiKey = validateApiKey;
|
|
91
|
-
/** Update the extension manifest file. */
|
|
92
|
-
function writeManifest({ all_frames, exclude_globs }) {
|
|
93
|
-
const manifestPath = path_1.default.join(exports.PATH_TO_EXTENSION, 'manifest.json');
|
|
94
|
-
const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf-8'));
|
|
95
|
-
manifest.content_scripts[0].all_frames = all_frames;
|
|
96
|
-
manifest.content_scripts[0].exclude_globs = exclude_globs;
|
|
97
|
-
fs_1.default.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
|
|
98
|
-
}
|
|
99
|
-
exports.writeManifest = writeManifest;
|
|
100
|
-
const readVariables = () => {
|
|
101
|
-
const fileContents = fs_1.default.readFileSync(exports.PATH_TO_EXTENSION_VARIABLES, 'utf-8');
|
|
102
|
-
return JSON.parse(fileContents);
|
|
103
|
-
};
|
|
104
|
-
exports.readVariables = readVariables;
|
|
105
|
-
const updateAutoAnalyze = (val) => {
|
|
106
|
-
const variables = (0, exports.readVariables)();
|
|
107
|
-
variables.auto_analyze = val;
|
|
108
|
-
fs_1.default.writeFileSync(exports.PATH_TO_EXTENSION_VARIABLES, JSON.stringify(variables));
|
|
109
|
-
};
|
|
110
|
-
exports.updateAutoAnalyze = updateAutoAnalyze;
|
|
111
|
-
const kWrapped = Symbol('axe watcher wrapped');
|
|
112
|
-
/** Is the given object wrapped? */
|
|
113
|
-
const isWrapped = (o) => {
|
|
114
|
-
if (!o) {
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
return o[kWrapped] === true;
|
|
118
|
-
};
|
|
119
|
-
exports.isWrapped = isWrapped;
|
|
120
|
-
/** Mark the given object as wrapped. */
|
|
121
|
-
const markAsWrapped = (o) => {
|
|
122
|
-
Object.defineProperty(o, kWrapped, {
|
|
123
|
-
configurable: false,
|
|
124
|
-
enumerable: false,
|
|
125
|
-
value: true
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
exports.markAsWrapped = markAsWrapped;
|
|
129
|
-
const proxiedGetFuncWithAnalyze = (target, prop, controller) => async (...args) => {
|
|
130
|
-
await controller.analyze({ __UserRequestedAnalyze: false });
|
|
131
|
-
// We use .call(target, ...) for the same reason that
|
|
132
|
-
// proxiedGetWithoutAnalyze uses .bind(target), see below.
|
|
133
|
-
//
|
|
134
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
135
|
-
const result = await target[prop].call(target, ...args);
|
|
136
|
-
return result;
|
|
137
|
-
};
|
|
138
|
-
exports.proxiedGetFuncWithAnalyze = proxiedGetFuncWithAnalyze;
|
|
139
|
-
const proxiedGetWithoutAnalyze = (target, prop) => {
|
|
140
|
-
const original = target[prop];
|
|
141
|
-
if (typeof original === 'function') {
|
|
142
|
-
// Override the proxied function with the original function bound to the target.
|
|
143
|
-
// This allows the "this" context to mimic the original object, rather than the proxy.
|
|
144
|
-
// Doing it this way still satisfies if:
|
|
145
|
-
// 1. The original function uses a private field of the target,
|
|
146
|
-
// it will throw an error if we try to call it in the context of
|
|
147
|
-
// a proxy rather than the original object. See #1052.
|
|
148
|
-
// 2. The original function is implemented in terms of a different
|
|
149
|
-
// method which we *do* wrap, we *don't* want to hook that inner
|
|
150
|
-
// call with an analyze(); we want to be intentional about the
|
|
151
|
-
// specific user-facing methods that we hook.
|
|
152
|
-
const originalFnName = original.name;
|
|
153
|
-
const boundNameOverride = {
|
|
154
|
-
// ends up identical to the original; JavaScript names anonymous functions
|
|
155
|
-
// in objects after the key they're bound to.
|
|
156
|
-
// @see https://github.com/dequelabs/jazzband/issues/1107
|
|
157
|
-
// @see https://stackoverflow.com/a/41854075
|
|
158
|
-
[originalFnName]: function (...args) {
|
|
159
|
-
return original.call(target, ...args);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
return boundNameOverride[originalFnName];
|
|
163
|
-
}
|
|
164
|
-
return original;
|
|
165
|
-
};
|
|
166
|
-
exports.proxiedGetWithoutAnalyze = proxiedGetWithoutAnalyze;
|
|
167
|
-
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;AAAA,+BAAiC;AACjC,gEAAkC;AAClC,oDAA2B;AAC3B,4CAAmB;AACnB,gDAAuB;AACvB,4CAAmB;AAGN,QAAA,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;AAC3D,QAAA,kBAAkB,GAAG,wBAAwB,CAAA;AAC7C,QAAA,oBAAoB,GAAG,cAAI,CAAC,IAAI,CAC3C,YAAE,CAAC,MAAM,EAAE,EACX,0BAA0B,CAC3B,CAAA;AACY,QAAA,2BAA2B,GAAG,cAAI,CAAC,IAAI,CAClD,yBAAiB,EACjB,gBAAgB,CACjB,CAAA;AAEY,QAAA,aAAa,GAAG;IAC3B,+BAA+B,yBAAiB,EAAE;IAClD,oBAAoB,yBAAiB,EAAE;CAC/B,CAAA;AAEV,MAAa,yBAA0B,SAAQ,KAAK;IAGlD,YAAY,eAAwB;QAClC,KAAK,CACH,wEAAwE;YACtE,mDAAmD;Y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