@xlinklight/browser-extension-tools 0.0.0-stage → 1.0.0-rc.0

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.
@@ -0,0 +1,127 @@
1
+ (function initializeLinkLightSidePanelBootstrap(global) {
2
+ function createSidePanelBootstrap({
3
+ extensionRuntime,
4
+ languagePreferenceStorageKey,
5
+ localeDirectories,
6
+ fallbackLocale = "zh-CN",
7
+ sidePanelTabs,
8
+ elements,
9
+ initialStatusKey = "statusWaiting",
10
+ onAfterStaticTranslations,
11
+ onDisabledTab,
12
+ onTabActivated,
13
+ onLanguageChanged,
14
+ }) {
15
+ const { interpolate, loadLocaleMessageMap, normalizeLanguagePreference, resolveLocale } = global.LinkLightSidePanelI18n;
16
+ const { updateCount, updateStatus } = global.LinkLightSidePanelStatus;
17
+ const { applySidePanelTranslations } = global.LinkLightSidePanelTranslations;
18
+ const {
19
+ activateSidePanelTab,
20
+ initializeSidePanelTabs: initializeSharedSidePanelTabs,
21
+ } = global.LinkLightSidePanelTabs;
22
+
23
+ let messages = {};
24
+ let languagePreference = "auto";
25
+ let activeLocale = fallbackLocale;
26
+ const activeStatus = { key: initialStatusKey, values: {} };
27
+
28
+ function t(key, values = {}) {
29
+ return interpolate(messages[key] ?? key, values);
30
+ }
31
+
32
+ async function readLanguagePreference() {
33
+ const result = await extensionRuntime.storage.get([languagePreferenceStorageKey]);
34
+ return normalizeLanguagePreference(result?.[languagePreferenceStorageKey]);
35
+ }
36
+
37
+ async function saveLanguagePreference(preference) {
38
+ await extensionRuntime.storage.set({ [languagePreferenceStorageKey]: normalizeLanguagePreference(preference) });
39
+ }
40
+
41
+ async function loadMessages(locale) {
42
+ messages = await loadLocaleMessageMap({ runtime: extensionRuntime, locale, localeDirectories, fallbackLocale });
43
+ }
44
+
45
+ function applyTranslations() {
46
+ applySidePanelTranslations({
47
+ t,
48
+ locale: activeLocale,
49
+ languageInput: elements.languageInput,
50
+ languagePreference,
51
+ safetyNote: elements.safetyNote,
52
+ onAfterStaticTranslations,
53
+ });
54
+ }
55
+
56
+ function setStatus(key, values = {}) {
57
+ updateStatus({ state: activeStatus, key, values, statusText: elements.statusText, t });
58
+ }
59
+
60
+ function setCount(value) {
61
+ updateCount({ count: elements.count, value, t });
62
+ }
63
+
64
+ function getErrorStatusKey(error, fallbackKey) {
65
+ const key = error instanceof Error ? error.message : "";
66
+ return messages[key] ? key : fallbackKey;
67
+ }
68
+
69
+ function activateTab(tabId) {
70
+ activateSidePanelTab(tabId);
71
+ }
72
+
73
+ function initializeSidePanelTabs() {
74
+ initializeSharedSidePanelTabs({
75
+ tabs: sidePanelTabs,
76
+ onActivate: (tab) => {
77
+ activateTab(tab.id);
78
+ onTabActivated?.(tab, api);
79
+ },
80
+ onDisabled: (tab) => {
81
+ if (typeof onDisabledTab === "function") {
82
+ onDisabledTab(tab, api);
83
+ return;
84
+ }
85
+ setStatus("statusFeatureComingSoon", { feature: t(tab.labelKey) });
86
+ },
87
+ });
88
+ }
89
+
90
+ async function initializeI18n() {
91
+ languagePreference = await readLanguagePreference();
92
+ activeLocale = resolveLocale({ preference: languagePreference, runtime: extensionRuntime, fallbackLocale });
93
+ await loadMessages(activeLocale);
94
+ applyTranslations();
95
+ setStatus(initialStatusKey);
96
+ }
97
+
98
+ async function handleLanguagePreferenceChange() {
99
+ languagePreference = normalizeLanguagePreference(elements.languageInput.value);
100
+ await saveLanguagePreference(languagePreference);
101
+ activeLocale = resolveLocale({ preference: languagePreference, runtime: extensionRuntime, fallbackLocale });
102
+ await loadMessages(activeLocale);
103
+ applyTranslations();
104
+ onLanguageChanged?.(api);
105
+ }
106
+
107
+ const api = {
108
+ activateTab,
109
+ applyTranslations,
110
+ getActiveLocale: () => activeLocale,
111
+ getCurrentStatus: () => activeStatus,
112
+ getErrorStatusKey,
113
+ getLanguagePreference: () => languagePreference,
114
+ getMessages: () => messages,
115
+ handleLanguagePreferenceChange,
116
+ initializeI18n,
117
+ initializeSidePanelTabs,
118
+ setCount,
119
+ setStatus,
120
+ t,
121
+ };
122
+
123
+ return api;
124
+ }
125
+
126
+ global.LinkLightSidePanelBootstrap = { createSidePanelBootstrap };
127
+ })(globalThis);
@@ -0,0 +1,15 @@
1
+ (function initializeLinkLightSidePanelDom(global) {
2
+ function appendText(parent, className, text) {
3
+ const element = global.document.createElement("div");
4
+ element.className = className;
5
+ element.textContent = text;
6
+ parent.append(element);
7
+ return element;
8
+ }
9
+
10
+ function setBusy(button, busy) {
11
+ button.disabled = busy;
12
+ }
13
+
14
+ global.LinkLightSidePanelDom = { appendText, setBusy };
15
+ })(globalThis);
@@ -0,0 +1,37 @@
1
+ (function initializeLinkLightSidePanelI18n(global) {
2
+ function normalizeChromeLocale(locale, fallbackLocale = "zh-CN") {
3
+ const normalized = String(locale || "").toLowerCase();
4
+ if (normalized.startsWith("en")) return "en-US";
5
+ return fallbackLocale;
6
+ }
7
+
8
+ function normalizeLanguagePreference(value) {
9
+ if (value === "zh-CN" || value === "en-US") return value;
10
+ return "auto";
11
+ }
12
+
13
+ function resolveLocale({ preference, runtime, fallbackLocale = "zh-CN" }) {
14
+ if (preference === "zh-CN" || preference === "en-US") return preference;
15
+ return normalizeChromeLocale(runtime.getUILocale(), fallbackLocale);
16
+ }
17
+
18
+ function interpolate(template, values = {}) {
19
+ return String(template || "").replace(/\{(\w+)\}/g, (_match, key) => String(values[key] ?? ""));
20
+ }
21
+
22
+ async function loadLocaleMessageMap({ runtime, locale, localeDirectories, fallbackLocale = "zh-CN" }) {
23
+ const directory = localeDirectories[locale] ?? localeDirectories[fallbackLocale];
24
+ const catalog = await runtime.loadLocaleMessages(directory);
25
+ return Object.fromEntries(
26
+ Object.entries(catalog).map(([key, value]) => [key, typeof value?.message === "string" ? value.message : ""]),
27
+ );
28
+ }
29
+
30
+ global.LinkLightSidePanelI18n = {
31
+ interpolate,
32
+ loadLocaleMessageMap,
33
+ normalizeChromeLocale,
34
+ normalizeLanguagePreference,
35
+ resolveLocale,
36
+ };
37
+ })(globalThis);
@@ -0,0 +1,7 @@
1
+ (function initializeLinkLightSidePanelImportPreview(global) {
2
+ function filterImportableDrafts(drafts, predicate) {
3
+ return (drafts || []).filter(predicate);
4
+ }
5
+
6
+ global.LinkLightSidePanelImportPreview = { filterImportableDrafts };
7
+ })(globalThis);
@@ -0,0 +1,13 @@
1
+ (function initializeLinkLightSidePanelStatus(global) {
2
+ function updateStatus({ state, key, values = {}, statusText, t }) {
3
+ state.key = key;
4
+ state.values = values;
5
+ statusText.textContent = t(key, values);
6
+ }
7
+
8
+ function updateCount({ count, value, t }) {
9
+ count.textContent = t("countLabel", { count: value });
10
+ }
11
+
12
+ global.LinkLightSidePanelStatus = { updateCount, updateStatus };
13
+ })(globalThis);
@@ -0,0 +1,35 @@
1
+ (function initializeLinkLightSidePanelTabs(global) {
2
+ function activateSidePanelTab(tabId, { documentRef = global.document } = {}) {
3
+ for (const button of documentRef.querySelectorAll("[data-tab]")) {
4
+ if (button.dataset.tab === tabId) button.setAttribute("aria-current", "page");
5
+ else button.removeAttribute("aria-current");
6
+ }
7
+
8
+ for (const panel of documentRef.querySelectorAll("[data-tab-panel]")) {
9
+ panel.hidden = panel.dataset.tabPanel !== tabId;
10
+ }
11
+ }
12
+
13
+ function initializeSidePanelTabs({
14
+ tabs,
15
+ documentRef = global.document,
16
+ onActivate,
17
+ onDisabled,
18
+ }) {
19
+ for (const button of documentRef.querySelectorAll("[data-tab]")) {
20
+ const tab = tabs.find((item) => item.id === button.dataset.tab);
21
+ if (!tab) continue;
22
+
23
+ button.addEventListener("click", () => {
24
+ if (tab.disabled) {
25
+ onDisabled?.(tab);
26
+ return;
27
+ }
28
+
29
+ onActivate?.(tab);
30
+ });
31
+ }
32
+ }
33
+
34
+ global.LinkLightSidePanelTabs = { activateSidePanelTab, initializeSidePanelTabs };
35
+ })(globalThis);
@@ -0,0 +1,41 @@
1
+ (function initializeLinkLightSidePanelTranslations(global) {
2
+ function applySidePanelTranslations({
3
+ documentRef = global.document,
4
+ t,
5
+ locale,
6
+ titleKey = "extensionName",
7
+ languageInput,
8
+ languagePreference,
9
+ safetyNote,
10
+ onAfterStaticTranslations,
11
+ }) {
12
+ documentRef.documentElement.lang = locale;
13
+ documentRef.title = t(titleKey);
14
+
15
+ for (const element of documentRef.querySelectorAll("[data-i18n]")) {
16
+ element.textContent = t(element.dataset.i18n);
17
+ }
18
+
19
+ for (const element of documentRef.querySelectorAll("[data-i18n-placeholder]")) {
20
+ element.setAttribute("placeholder", t(element.dataset.i18nPlaceholder));
21
+ }
22
+
23
+ for (const element of documentRef.querySelectorAll("[data-i18n-aria-label]")) {
24
+ element.setAttribute("aria-label", t(element.dataset.i18nAriaLabel));
25
+ }
26
+
27
+ for (const element of documentRef.querySelectorAll("[data-i18n-title]")) {
28
+ const values = {};
29
+ if (element.dataset.i18nTitleFeatureKey) {
30
+ values.feature = t(element.dataset.i18nTitleFeatureKey);
31
+ }
32
+ element.setAttribute("title", t(element.dataset.i18nTitle, values));
33
+ }
34
+
35
+ if (safetyNote) safetyNote.textContent = t("safetyNote");
36
+ if (languageInput) languageInput.value = languagePreference;
37
+ if (typeof onAfterStaticTranslations === "function") onAfterStaticTranslations();
38
+ }
39
+
40
+ global.LinkLightSidePanelTranslations = { applySidePanelTranslations };
41
+ })(globalThis);
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "@xlinklight/browser-extension-tools",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0-rc.0",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/zopenge/link-light.git",
8
+ "directory": "packages/browser-extension-tools"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public",
12
+ "registry": "https://registry.npmjs.org",
13
+ "provenance": false
14
+ },
15
+ "type": "module",
16
+ "private": false,
17
+ "files": [
18
+ "src",
19
+ "assets",
20
+ "README.md"
21
+ ],
22
+ "bin": {
23
+ "link-light-extension-dev": "src/dev-cli.mjs",
24
+ "link-light-extension-package": "src/package-cli.mjs"
25
+ },
26
+ "exports": {
27
+ "./dev": "./src/run.mjs",
28
+ "./cli": "./src/cli.mjs",
29
+ "./package": "./src/package.mjs",
30
+ "./installer": "./src/chrome-for-testing.mjs",
31
+ "./shared/*": "./assets/shared/*"
32
+ },
33
+ "dependencies": {
34
+ "@openge/forge-artifact-integrity": "0.1.0",
35
+ "@openge/forge-command-runner": "0.1.0-rc.1",
36
+ "@openge/forge-process-control-node": "0.1.0"
37
+ },
38
+ "engines": {
39
+ "node": ">=22.14.0"
40
+ },
41
+ "scripts": {
42
+ "test": "node --test tests/*.test.mjs"
43
+ }
6
44
  }
@@ -0,0 +1,231 @@
1
+ import { createHash } from "node:crypto";
2
+ import { existsSync, readdirSync, statSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { chromeExtensionsUrl, getArgValue, getChromeLaunchExtensionDirs, getProfileDirForExtensions, getProjectPaths, getRequestedAppUrl, getRequestedBrowser, getRequestedExtensions } from "./cli.mjs";
5
+
6
+ export function normalizeChromeExtensionPath(extensionPath, platform) {
7
+ const pathApi = platform === "win32" ? path.win32 : path.posix;
8
+ const resolvedPath = pathApi.resolve(extensionPath);
9
+
10
+ if (platform !== "win32") {
11
+ return resolvedPath;
12
+ }
13
+
14
+ return resolvedPath.replace(/^([a-z]):/, (_, driveLetter) => `${driveLetter.toUpperCase()}:`);
15
+ }
16
+
17
+ export function getChromeExtensionIdForPath(extensionPath, { platform = process.platform } = {}) {
18
+ const normalizedPath = normalizeChromeExtensionPath(extensionPath, platform);
19
+ const pathBytes = platform === "win32" ? Buffer.from(normalizedPath, "utf16le") : Buffer.from(normalizedPath);
20
+ const digest = createHash("sha256").update(pathBytes).digest("hex").slice(0, 32);
21
+
22
+ return digest.replace(/[0-9a-f]/g, (character) => "abcdefghijklmnop"[Number.parseInt(character, 16)]);
23
+ }
24
+
25
+ export function getChromeExecutableName(platform) {
26
+ if (platform === "win32") return "chrome.exe";
27
+ if (platform === "darwin") return "Google Chrome for Testing";
28
+ return "chrome";
29
+ }
30
+
31
+ export function findExecutableBelow(directory, executableName) {
32
+ const entries = readdirSync(directory, { withFileTypes: true });
33
+
34
+ for (const entry of entries) {
35
+ const entryPath = path.join(directory, entry.name);
36
+ if (entry.isFile() && entry.name === executableName) {
37
+ return entryPath;
38
+ }
39
+ if (entry.isDirectory()) {
40
+ const foundPath = findExecutableBelow(entryPath, executableName);
41
+ if (foundPath) return foundPath;
42
+ }
43
+ }
44
+
45
+ return null;
46
+ }
47
+
48
+ export function findLocalChromeForTesting({
49
+ rootDir = process.cwd(),
50
+ platform = process.platform,
51
+ exists = existsSync,
52
+ } = {}) {
53
+ const { chromeForTestingDir } = getProjectPaths(rootDir);
54
+ if (!exists(chromeForTestingDir)) {
55
+ return null;
56
+ }
57
+
58
+ try {
59
+ if (!statSync(chromeForTestingDir).isDirectory()) {
60
+ return null;
61
+ }
62
+ return findExecutableBelow(chromeForTestingDir, getChromeExecutableName(platform));
63
+ } catch (error) {
64
+ if (error?.code === "ENOENT") {
65
+ return null;
66
+ }
67
+ throw error;
68
+ }
69
+ }
70
+
71
+ export function isLikelyGoogleChromeOrChromeForTesting(chromePath) {
72
+ const normalizedPath = chromePath.toLowerCase().replaceAll("\\", "/");
73
+
74
+ return (
75
+ normalizedPath.includes("chrome for testing") ||
76
+ normalizedPath.includes("chrome-for-testing") ||
77
+ normalizedPath.includes("chrome-win64") ||
78
+ normalizedPath.includes("/google/chrome/application/chrome.exe") ||
79
+ normalizedPath.endsWith("/google chrome")
80
+ );
81
+ }
82
+
83
+ export function candidateChromePaths({ browser, env, platform }) {
84
+ if (platform === "win32") {
85
+ if (browser === "chrome") {
86
+ return [
87
+ env.CHROME_FOR_TESTING_PATH,
88
+ env.LOCALAPPDATA && path.join(env.LOCALAPPDATA, "Google", "Chrome", "Application", "chrome.exe"),
89
+ env.PROGRAMFILES && path.join(env.PROGRAMFILES, "Google", "Chrome", "Application", "chrome.exe"),
90
+ env["PROGRAMFILES(X86)"] && path.join(env["PROGRAMFILES(X86)"], "Google", "Chrome", "Application", "chrome.exe"),
91
+ String.raw`C:\Program Files\Google\Chrome\Application\chrome.exe`,
92
+ String.raw`C:\Program Files (x86)\Google\Chrome\Application\chrome.exe`,
93
+ ].filter(Boolean);
94
+ }
95
+
96
+ return [
97
+ env.CHROME_FOR_TESTING_PATH,
98
+ env.LOCALAPPDATA && path.join(env.LOCALAPPDATA, "Chromium", "Application", "chrome.exe"),
99
+ env.PROGRAMFILES && path.join(env.PROGRAMFILES, "Chromium", "Application", "chrome.exe"),
100
+ env["PROGRAMFILES(X86)"] && path.join(env["PROGRAMFILES(X86)"], "Chromium", "Application", "chrome.exe"),
101
+ env.LOCALAPPDATA && path.join(env.LOCALAPPDATA, "Microsoft", "Edge", "Application", "msedge.exe"),
102
+ env.PROGRAMFILES && path.join(env.PROGRAMFILES, "Microsoft", "Edge", "Application", "msedge.exe"),
103
+ env["PROGRAMFILES(X86)"] && path.join(env["PROGRAMFILES(X86)"], "Microsoft", "Edge", "Application", "msedge.exe"),
104
+ env.LOCALAPPDATA && path.join(env.LOCALAPPDATA, "Google", "Chrome", "Application", "chrome.exe"),
105
+ env.PROGRAMFILES && path.join(env.PROGRAMFILES, "Google", "Chrome", "Application", "chrome.exe"),
106
+ env["PROGRAMFILES(X86)"] && path.join(env["PROGRAMFILES(X86)"], "Google", "Chrome", "Application", "chrome.exe"),
107
+ String.raw`C:\Program Files\Microsoft\Edge\Application\msedge.exe`,
108
+ String.raw`C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe`,
109
+ String.raw`C:\Program Files\Google\Chrome\Application\chrome.exe`,
110
+ String.raw`C:\Program Files (x86)\Google\Chrome\Application\chrome.exe`,
111
+ ].filter(Boolean);
112
+ }
113
+
114
+ if (platform === "darwin") {
115
+ return ["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"];
116
+ }
117
+
118
+ if (browser === "chrome") {
119
+ return ["/usr/bin/google-chrome", "/usr/bin/google-chrome-stable"];
120
+ }
121
+
122
+ return ["/usr/bin/chromium", "/snap/bin/chromium", "/usr/bin/microsoft-edge", "/usr/bin/google-chrome", "/usr/bin/google-chrome-stable"];
123
+ }
124
+
125
+ export function findChromePath({
126
+ argv = process.argv.slice(2),
127
+ env = process.env,
128
+ exists = existsSync,
129
+ platform = process.platform,
130
+ rootDir = process.cwd(),
131
+ } = {}) {
132
+ const requestedBrowser = getRequestedBrowser(argv);
133
+ const explicitChromePath = getArgValue(argv, "--chrome-path") || env.CHROME_FOR_TESTING_PATH;
134
+ if (explicitChromePath?.trim()) {
135
+ return explicitChromePath.trim();
136
+ }
137
+
138
+ const localChromeForTestingPath = findLocalChromeForTesting({ rootDir, platform, exists });
139
+ if (localChromeForTestingPath) {
140
+ return localChromeForTestingPath;
141
+ }
142
+
143
+ if (
144
+ env.CHROME_PATH?.trim() &&
145
+ (!requestedBrowser || isLikelyGoogleChromeOrChromeForTesting(env.CHROME_PATH.trim()))
146
+ ) {
147
+ return env.CHROME_PATH.trim();
148
+ }
149
+
150
+ const foundPath = candidateChromePaths({ browser: requestedBrowser, env, platform }).find((candidate) => exists(candidate));
151
+ if (foundPath) {
152
+ return foundPath;
153
+ }
154
+
155
+ throw new Error(
156
+ "Chrome executable was not found. Set CHROME_PATH or pass --chrome-path=<path-to-chrome>.",
157
+ );
158
+ }
159
+
160
+ export function isLikelyBrandedChrome(chromePath) {
161
+ const normalizedPath = chromePath.toLowerCase().replaceAll("\\", "/");
162
+
163
+ if (normalizedPath.includes("chrome for testing") || normalizedPath.includes("chrome-for-testing")) {
164
+ return false;
165
+ }
166
+ if (normalizedPath.includes("chrome-win64") || normalizedPath.includes("chromium") || normalizedPath.includes("/microsoft/edge/")) {
167
+ return false;
168
+ }
169
+
170
+ return normalizedPath.includes("/google/chrome/application/chrome.exe") || normalizedPath.endsWith("/google chrome");
171
+ }
172
+
173
+ export function buildChromeLaunchConfig({
174
+ argv = process.argv.slice(2),
175
+ env = process.env,
176
+ existsSync: exists = existsSync,
177
+ platform = process.platform,
178
+ rootDir = process.cwd(),
179
+ extensionRoot = getArgValue(argv, "--extension-root"),
180
+ extensionName,
181
+ extensionNames = extensionName ? [extensionName] : getRequestedExtensions(argv, rootDir),
182
+ appUrl = getRequestedAppUrl(argv, env),
183
+ profileDir = getProfileDirForExtensions(rootDir, extensionNames, extensionRoot),
184
+ } = {}) {
185
+ const launchExtensionDirs = getChromeLaunchExtensionDirs({ extensionNames, rootDir, extensionRoot });
186
+ const launchExtensionArg = launchExtensionDirs.join(",");
187
+ const url = getArgValue(argv, "--url") || appUrl;
188
+ const chromePath = findChromePath({ argv, env, exists, platform, rootDir });
189
+ const autoLoadSupported = argv.includes("--allow-branded-chrome") || !isLikelyBrandedChrome(chromePath);
190
+ const baseArgs = [
191
+ `--user-data-dir=${profileDir}`,
192
+ "--new-window",
193
+ "--no-first-run",
194
+ "--no-default-browser-check",
195
+ ];
196
+
197
+ if (!autoLoadSupported) {
198
+ return {
199
+ autoLoadSupported,
200
+ chromePath,
201
+ launchExtensionDirs,
202
+ args: [...baseArgs, chromeExtensionsUrl, url],
203
+ manualLoadPath: launchExtensionDirs.join(", "),
204
+ resetProfile: argv.includes("--reset-profile"),
205
+ unsupportedAutoLoadReason:
206
+ "Automatic unpacked extension loading is disabled in current branded Chrome builds. Use Chrome for Testing for one-command loading, or load the unpacked extension manually.",
207
+ };
208
+ }
209
+
210
+ return {
211
+ autoLoadSupported,
212
+ chromePath,
213
+ launchExtensionDirs,
214
+ args: [
215
+ ...baseArgs,
216
+ `--load-extension=${launchExtensionArg}`,
217
+ `--disable-extensions-except=${launchExtensionArg}`,
218
+ chromeExtensionsUrl,
219
+ url,
220
+ ],
221
+ resetProfile: argv.includes("--reset-profile"),
222
+ };
223
+ }
224
+
225
+ export function samePath(left, right) {
226
+ const resolvedLeft = path.resolve(left);
227
+ const resolvedRight = path.resolve(right);
228
+ return process.platform === "win32"
229
+ ? resolvedLeft.toLowerCase() === resolvedRight.toLowerCase()
230
+ : resolvedLeft === resolvedRight;
231
+ }