webext-schema 5.1.5 → 5.1.7

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.
@@ -178,7 +178,7 @@ export const updateCommand = async (id, value = '') => {
178
178
  value.trim().replace(/\+([a-z])$/, (m, c) => `+${c.toUpperCase()}`);
179
179
  if (shortcut === '') {
180
180
  func = commands.reset(id);
181
- } else if (/^(?:(?:(?:Alt|Command|(?:Mac)?Ctrl)(?:\+Shift)?|Alt\+(?:Command|(?:Mac)?Ctrl)|Command\+(?:Alt|MacCtrl)|Ctrl\+(?:Alt|MacCtrl)|MacCtrl\+(?:Alt|Command|Ctrl))\+(?:[\dA-Z]|F(?:[1-9]|1[0-2])|(?:Page)?(?:Down|Up)|Left|Right|Comma|Period|Home|End|Delete|Insert|Space))|F(?:[1-9]|1[0-2])|Media(?:(?:Next|Prev)Track|PlayPause|Stop)$/.test(shortcut)) {
181
+ } else if (/^(?:(?:Alt|Command|(?:Mac)?Ctrl)(?:\+Shift)?|Alt\+(?:Command|(?:Mac)?Ctrl)|Command\+(?:Alt|MacCtrl)|Ctrl\+(?:Alt|MacCtrl)|MacCtrl\+(?:Alt|Command|Ctrl))\+[\dA-Z]|F[1-9]|Media(?:(?:Next|Prev)Track|PlayPause|Stop)$/.test(shortcut)) {
182
182
  func = commands.update({
183
183
  shortcut,
184
184
  name: id
@@ -967,7 +967,7 @@ export const highlightTab = async (index, windowId) => {
967
967
  * move tab
968
968
  *
969
969
  * @param {number|Array} tabId - tab ID
970
- * @param {object} opt - options
970
+ * @param {object} [opt] - options
971
971
  * @returns {Promise.<?Array>} - array of tabs.Tab
972
972
  */
973
973
  export const moveTab = async (tabId, opt) => {
@@ -978,7 +978,7 @@ export const moveTab = async (tabId, opt) => {
978
978
  if (arr && !Array.isArray(arr)) {
979
979
  arr = [arr];
980
980
  }
981
- return arr ?? null;
981
+ return arr || null;
982
982
  };
983
983
 
984
984
  /**
@@ -128,7 +128,7 @@ export const getFileTimestamp = file => {
128
128
  export const getFileNameFromFilePath = (file, subst = SUBST) => {
129
129
  let name;
130
130
  if (isString(file) && isFile(file) &&
131
- /^([^.]+)(?:\..+)?$/.test(path.basename(file))) {
131
+ /^[^.]+(?:\..+)?$/.test(path.basename(file))) {
132
132
  [, name] = /^([^.]+)(?:\..+)?$/.exec(path.basename(file));
133
133
  }
134
134
  return name || subst;
package/modules/schema.js CHANGED
@@ -28,7 +28,7 @@ export class Schema {
28
28
  constructor(...args) {
29
29
  const [arg1, arg2] = args;
30
30
  this.#channel =
31
- isString(arg1) && /(?:(?:centra|mai)l|beta|esr|release)/.test(arg1)
31
+ isString(arg1) && /(?:centra|mai)l|beta|esr|release/.test(arg1)
32
32
  ? arg1
33
33
  : 'beta';
34
34
  this._sandbox =
@@ -47,7 +47,7 @@ export class Schema {
47
47
  }
48
48
 
49
49
  set channel(ch) {
50
- if (isString(ch) && /(?:(?:centra|mai)l|beta|esr|release)/.test(ch)) {
50
+ if (isString(ch) && /(?:centra|mai)l|beta|esr|release/.test(ch)) {
51
51
  this.#channel = ch;
52
52
  }
53
53
  }
package/modules/update.js CHANGED
@@ -96,7 +96,7 @@ export const getFileList = async baseUrl => {
96
96
  const { href } = new URL('jar.mn', baseUrl);
97
97
  const text = await fetchText(href);
98
98
  const reg =
99
- /content\/(?:(?:brows|messeng)er|extensions)\/schemas\/([\da-zA-Z_]+\.json)/;
99
+ /content\/(?:(?:brows|messeng)er|extensions)\/schemas\/(\w+\.json)/;
100
100
  const items = text.split('\n');
101
101
  const arr = [];
102
102
  for (const item of items) {
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "types": "types/index.d.ts",
15
15
  "dependencies": {
16
16
  "@types/firefox-webext-browser": "^109.0.0",
17
- "@types/node": "^18.14.1",
17
+ "@types/node": "^18.14.2",
18
18
  "@types/sinon": "^10.0.13",
19
19
  "camelize": "^1.0.1",
20
20
  "commander": "^10.0.0",
@@ -25,12 +25,13 @@
25
25
  "devDependencies": {
26
26
  "c8": "^7.13.0",
27
27
  "chai": "^4.3.7",
28
- "eslint": "^8.34.0",
28
+ "eslint": "^8.35.0",
29
29
  "eslint-config-standard": "^17.0.0",
30
30
  "eslint-plugin-import": "^2.27.5",
31
31
  "eslint-plugin-jsdoc": "^40.0.0",
32
32
  "eslint-plugin-node": "^11.1.0",
33
33
  "eslint-plugin-promise": "^6.1.1",
34
+ "eslint-plugin-regexp": "^1.12.0",
34
35
  "eslint-plugin-unicorn": "^45.0.2",
35
36
  "mocha": "^10.2.0",
36
37
  "npm-run-all": "^4.1.5",
@@ -55,5 +56,5 @@
55
56
  "update-mail": "node index update --channel=mail -i",
56
57
  "update-release": "node index update --channel=release -i"
57
58
  },
58
- "version": "5.1.5"
59
+ "version": "5.1.7"
59
60
  }
@@ -45,7 +45,7 @@ export function getAllTabsInWindow(windowId?: number): Promise<any[] | null>;
45
45
  export function getHighlightedTab(windowId?: number): Promise<any[] | null>;
46
46
  export function getTab(tabId: number): Promise<object>;
47
47
  export function highlightTab(index: number | any[], windowId?: number): Promise<object>;
48
- export function moveTab(tabId: number | any[], opt: object): Promise<any[] | null>;
48
+ export function moveTab(tabId: number | any[], opt?: object): Promise<any[] | null>;
49
49
  export function reloadTab(tabId: number, opt: object): Promise<void>;
50
50
  export function removeTab(arg: number | any[]): Promise<void>;
51
51
  export function updateTab(tabId: number, opt: object): Promise<object>;