textbrowser 0.54.0 → 0.54.2

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.
Files changed (91) hide show
  1. package/CHANGES.md +8 -0
  2. package/dist/WorkInfo-es.js +172 -355
  3. package/dist/activateCallback-es.js +0 -1
  4. package/dist/index-es.js +3294 -3414
  5. package/dist/index-es.min.js +4 -4
  6. package/eslint.config.js +2 -2
  7. package/package.json +44 -38
  8. package/resources/activateCallback.js +0 -1
  9. package/resources/index.js +0 -1
  10. package/resources/resultsDisplay.js +1 -9
  11. package/resources/templates/workDisplay.js +0 -1
  12. package/resources/utils/Plugin.js +2 -5
  13. package/resources/utils/WorkInfo.js +7 -15
  14. package/resources/workDisplay.js +0 -1
  15. package/resources/workSelect.js +0 -1
  16. package/server/main.js +15 -7
  17. package/sw-sample.js +0 -2
  18. package/tsconfig.json +2 -1
  19. package/dist/assets/index-_11XnUty.css +0 -9
  20. package/dist/assets/languages-1sAACTKG.json +0 -67
  21. package/dist/dist/WorkInfo-es.d.ts +0 -331
  22. package/dist/dist/WorkInfo-es.d.ts.map +0 -1
  23. package/dist/dist/activateCallback-es.d.ts +0 -17
  24. package/dist/dist/activateCallback-es.d.ts.map +0 -1
  25. package/dist/dist/index-es.d.ts +0 -619
  26. package/dist/dist/index-es.d.ts.map +0 -1
  27. package/dist/dist/sw-helper.d.ts +0 -3
  28. package/dist/dist/sw-helper.d.ts.map +0 -1
  29. package/dist/eslint.config.d.ts +0 -126
  30. package/dist/eslint.config.d.ts.map +0 -1
  31. package/dist/resources/activateCallback.d.ts +0 -23
  32. package/dist/resources/activateCallback.d.ts.map +0 -1
  33. package/dist/resources/index.d.ts +0 -128
  34. package/dist/resources/index.d.ts.map +0 -1
  35. package/dist/resources/resultsDisplay.d.ts +0 -110
  36. package/dist/resources/resultsDisplay.d.ts.map +0 -1
  37. package/dist/resources/templates/index.d.ts +0 -59
  38. package/dist/resources/templates/index.d.ts.map +0 -1
  39. package/dist/resources/templates/languageSelect.d.ts +0 -18
  40. package/dist/resources/templates/languageSelect.d.ts.map +0 -1
  41. package/dist/resources/templates/resultsDisplayClient.d.ts +0 -26
  42. package/dist/resources/templates/resultsDisplayClient.d.ts.map +0 -1
  43. package/dist/resources/templates/resultsDisplayServerOrClient.d.ts +0 -131
  44. package/dist/resources/templates/resultsDisplayServerOrClient.d.ts.map +0 -1
  45. package/dist/resources/templates/utils/dom.d.ts +0 -15
  46. package/dist/resources/templates/utils/dom.d.ts.map +0 -1
  47. package/dist/resources/templates/utils/html.d.ts +0 -3
  48. package/dist/resources/templates/utils/html.d.ts.map +0 -1
  49. package/dist/resources/templates/workDisplay.d.ts +0 -183
  50. package/dist/resources/templates/workDisplay.d.ts.map +0 -1
  51. package/dist/resources/templates/workSelect.d.ts +0 -18
  52. package/dist/resources/templates/workSelect.d.ts.map +0 -1
  53. package/dist/resources/user-sample.d.ts +0 -2
  54. package/dist/resources/user-sample.d.ts.map +0 -1
  55. package/dist/resources/user.d.ts +0 -2
  56. package/dist/resources/user.d.ts.map +0 -1
  57. package/dist/resources/utils/IntlURLSearchParams.d.ts +0 -56
  58. package/dist/resources/utils/IntlURLSearchParams.d.ts.map +0 -1
  59. package/dist/resources/utils/Languages.d.ts +0 -81
  60. package/dist/resources/utils/Languages.d.ts.map +0 -1
  61. package/dist/resources/utils/Metadata.d.ts +0 -133
  62. package/dist/resources/utils/Metadata.d.ts.map +0 -1
  63. package/dist/resources/utils/Params.d.ts +0 -30
  64. package/dist/resources/utils/Params.d.ts.map +0 -1
  65. package/dist/resources/utils/Plugin.d.ts +0 -278
  66. package/dist/resources/utils/Plugin.d.ts.map +0 -1
  67. package/dist/resources/utils/ServiceWorker.d.ts +0 -26
  68. package/dist/resources/utils/ServiceWorker.d.ts.map +0 -1
  69. package/dist/resources/utils/WorkInfo.d.ts +0 -104
  70. package/dist/resources/utils/WorkInfo.d.ts.map +0 -1
  71. package/dist/resources/utils/dialogs.d.ts +0 -155
  72. package/dist/resources/utils/dialogs.d.ts.map +0 -1
  73. package/dist/resources/utils/getLocaleFallbackResults.d.ts +0 -19
  74. package/dist/resources/utils/getLocaleFallbackResults.d.ts.map +0 -1
  75. package/dist/resources/utils/sanitize.d.ts +0 -6
  76. package/dist/resources/utils/sanitize.d.ts.map +0 -1
  77. package/dist/resources/vendor/json-refs-min.d.ts +0 -3
  78. package/dist/resources/vendor/json-refs-min.d.ts.map +0 -1
  79. package/dist/resources/workDisplay.d.ts +0 -81
  80. package/dist/resources/workDisplay.d.ts.map +0 -1
  81. package/dist/resources/workSelect.d.ts +0 -17
  82. package/dist/resources/workSelect.d.ts.map +0 -1
  83. package/dist/rollup.config.d.ts +0 -19
  84. package/dist/rollup.config.d.ts.map +0 -1
  85. package/dist/server/main.d.ts +0 -47
  86. package/dist/server/main.d.ts.map +0 -1
  87. package/dist/sw-helper.d.ts +0 -3
  88. package/dist/sw-helper.d.ts.map +0 -1
  89. package/dist/sw-helper.js +0 -355
  90. package/dist/sw-sample.d.ts +0 -2
  91. package/dist/sw-sample.d.ts.map +0 -1
package/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGES to `textbrowser`
2
2
 
3
+ ## 0.52.2
4
+
5
+ - chore: update simple-get-json, jsdom, devDeps., fix rollup, rebuild
6
+
7
+ ## 0.54.1
8
+
9
+ - fix: redefine `navigator.languages`
10
+
3
11
  ## 0.54.0
4
12
 
5
13
  - fix: avoid defining `navigator.languages` as reserved now by Node
@@ -1,338 +1,166 @@
1
- /**
2
- * @typedef {JSONValue[]} JSONArray
3
- */
4
- /**
5
- * @typedef {null|boolean|number|string|JSONArray|{[key: string]: JSONValue}} JSONValue
6
- */
7
-
8
- /**
9
- * @callback SimpleJSONCallback
10
- * @param {...JSONValue} json
11
- * @returns {void}
12
- */
13
-
14
- /**
15
- * @callback SimpleJSONErrback
16
- * @param {Error} err
17
- * @param {string|string[]} jsonURL
18
- * @returns {JSONValue}
19
- */
20
-
21
- /**
22
- * @typedef {((
23
- * jsonURL: string|string[],
24
- * cb?: SimpleJSONCallback,
25
- * errBack?: SimpleJSONErrback
26
- * ) => Promise<JSONValue>) & {
27
- * _fetch?: import('./index-polyglot.js').SimpleFetch,
28
- * hasURLBasePath?: boolean,
29
- * basePath?: string|false
30
- * }} getJSONCallback
31
- */
32
-
33
- /**
34
- * @param {object} [cfg]
35
- * @param {import('./index-polyglot.js').SimpleFetch} [cfg.fetch]
36
- * @returns {getJSONCallback}
37
- */
38
-
39
- function _await$2$1(value, then, direct) {
40
- if (!value || !value.then) {
41
- value = Promise.resolve(value);
42
- }
43
- return then ? value.then(then) : value;
44
- }
45
- function _invoke$1(body, then) {
46
- var result = body();
47
- if (result && result.then) {
48
- return result.then(then);
49
- }
50
- return then(result);
51
- }
52
- function _catch$2(body, recover) {
53
- try {
54
- var result = body();
55
- } catch (e) {
56
- return recover(e);
57
- }
58
- if (result && result.then) {
59
- return result.then(void 0, recover);
60
- }
61
- return result;
62
- }
63
- function buildGetJSONWithFetch({
64
- // eslint-disable-next-line no-shadow, no-undef -- This is a polyfill
65
- fetch = typeof window !== 'undefined' ? window.fetch : self.fetch
66
- } = {}) {
67
- /**
68
- * @type {getJSONCallback}
69
- */
70
- return function getJSON(jsonURL, cb, errBack) {
71
- try {
72
- let _exit = false;
73
- return _await$2$1(_catch$2(function () {
74
- return _invoke$1(function () {
75
- if (Array.isArray(jsonURL)) {
76
- return _await$2$1(Promise.all(jsonURL.map(url => {
77
- return /** @type {getJSONCallback} */getJSON(url);
78
- })), function (arrResult) {
79
- if (cb) {
80
- // eslint-disable-next-line promise/prefer-await-to-callbacks -- Old-style API
81
- cb(...arrResult);
82
- }
83
- _exit = true;
84
- return arrResult;
85
- });
86
- }
87
- }, function (_result) {
88
- return _exit ? _result : _await$2$1(fetch(jsonURL), function (resp) {
89
- return _await$2$1(resp.json(), function (result) {
90
- return typeof cb === 'function'
91
- // eslint-disable-next-line promise/prefer-await-to-callbacks -- Old-style API
92
- ? cb(result) : result;
93
- // https://github.com/bcoe/c8/issues/135
94
- /* c8 ignore next */
95
- });
96
- });
97
- });
98
- }, function (err) {
99
- const e = /** @type {Error} */err;
100
- e.message += ` (File: ${jsonURL})`;
101
- if (errBack) {
102
- return errBack(e, jsonURL);
103
- }
104
- throw e;
105
- // https://github.com/bcoe/c8/issues/135
106
- /* c8 ignore next */
107
- }));
108
- /* c8 ignore next */
109
- } catch (e) {
110
- return Promise.reject(e);
111
- }
112
- };
113
- }
114
-
115
- function _await$1$1(value, then, direct) {
116
- if (!value || !value.then) {
117
- value = Promise.resolve(value);
118
- }
119
- return then ? value.then(then) : value;
120
- }
121
- /* globals process -- Node */
122
-
123
- // Needed for polyglot support (no `path` in browser); even if
124
- // polyglot using dynamic `import` not supported by Rollup (complaining
125
- // of inability to do tree-shaking in UMD builds), still useful to delay
126
- // path import for our testing, so that test can import this file in
127
- // the browser without compilation without it choking
128
-
129
- /**
130
- * @type {(directory: string) => string}
131
- */
132
- let dirname;
133
-
134
- /** @type {boolean} */
135
-
136
- function _empty() {}
137
- let isWindows;
138
- function _invokeIgnored(body) {
139
- var result = body();
140
- if (result && result.then) {
141
- return result.then(_empty);
142
- }
143
- } /**
144
- * @param {string} path
145
- * @returns {string}
146
- */
147
-
148
- function _async$1$1(f) {
149
- return function () {
150
- for (var args = [], i = 0; i < arguments.length; i++) {
151
- args[i] = arguments[i];
152
- }
153
- try {
154
- return Promise.resolve(f.apply(this, args));
155
- } catch (e) {
156
- return Promise.reject(e);
157
- }
158
- };
1
+ var dist$1 = {exports: {}};
2
+
3
+ var dist = dist$1.exports;
4
+
5
+ var hasRequiredDist;
6
+
7
+ function requireDist () {
8
+ if (hasRequiredDist) return dist$1.exports;
9
+ hasRequiredDist = 1;
10
+ (function (module, exports) {
11
+ (function (global, factory) {
12
+ module.exports = factory() ;
13
+ })(dist, (function () {
14
+ function _arrayLikeToArray(r, a) {
15
+ (null == a || a > r.length) && (a = r.length);
16
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
17
+ return n;
18
+ }
19
+ function _arrayWithoutHoles(r) {
20
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
21
+ }
22
+ function _iterableToArray(r) {
23
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
24
+ }
25
+ function _nonIterableSpread() {
26
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
27
+ }
28
+ function _toConsumableArray(r) {
29
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
30
+ }
31
+ function _unsupportedIterableToArray(r, a) {
32
+ if (r) {
33
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
34
+ var t = {}.toString.call(r).slice(8, -1);
35
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
36
+ }
37
+ }
38
+
39
+ /**
40
+ * @typedef {JSONValue[]} JSONArray
41
+ */
42
+ /**
43
+ * @typedef {null|boolean|number|string|JSONArray|{[key: string]: JSONValue}} JSONValue
44
+ */
45
+
46
+ /**
47
+ * @callback SimpleJSONCallback
48
+ * @param {...JSONValue} json
49
+ * @returns {void}
50
+ */
51
+
52
+ /**
53
+ * @callback SimpleJSONErrback
54
+ * @param {Error} err
55
+ * @param {string|string[]} jsonURL
56
+ * @returns {JSONValue}
57
+ */
58
+
59
+ /**
60
+ * @typedef {((
61
+ * jsonURL: string|string[],
62
+ * cb?: SimpleJSONCallback,
63
+ * errBack?: SimpleJSONErrback
64
+ * ) => Promise<JSONValue>) & {
65
+ * _fetch?: import('./index-polyglot.js').SimpleFetch,
66
+ * hasURLBasePath?: boolean,
67
+ * basePath?: string|false
68
+ * }} getJSONCallback
69
+ */
70
+
71
+ /**
72
+ * @param {object} [cfg]
73
+ * @param {import('./index-polyglot.js').SimpleFetch} [cfg.fetch]
74
+ * @returns {getJSONCallback}
75
+ */
76
+
77
+ function _await(value, then, direct) {
78
+ if (!value || !value.then) {
79
+ value = Promise.resolve(value);
80
+ }
81
+ return then ? value.then(then) : value;
82
+ }
83
+ function _invoke(body, then) {
84
+ var result = body();
85
+ if (result && result.then) {
86
+ return result.then(then);
87
+ }
88
+ return then(result);
89
+ }
90
+ function _catch(body, recover) {
91
+ try {
92
+ var result = body();
93
+ } catch (e) {
94
+ return recover(e);
95
+ }
96
+ if (result && result.then) {
97
+ return result.then(void 0, recover);
98
+ }
99
+ return result;
100
+ }
101
+ function buildGetJSONWithFetch() {
102
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
103
+ _ref$fetch = _ref.fetch,
104
+ fetch = _ref$fetch === void 0 ? typeof window !== 'undefined' ? window.fetch : self.fetch : _ref$fetch;
105
+ /**
106
+ * @type {getJSONCallback}
107
+ */
108
+ return function getJSON(jsonURL, cb, errBack) {
109
+ try {
110
+ var _exit = false;
111
+ return _await(_catch(function () {
112
+ return _invoke(function () {
113
+ if (Array.isArray(jsonURL)) {
114
+ return _await(Promise.all(jsonURL.map(function (url) {
115
+ return /** @type {getJSONCallback} */getJSON(url);
116
+ })), function (arrResult) {
117
+ if (cb) {
118
+ // eslint-disable-next-line promise/prefer-await-to-callbacks -- Old-style API
119
+ cb.apply(void 0, _toConsumableArray(arrResult));
120
+ }
121
+ _exit = true;
122
+ return arrResult;
123
+ });
124
+ }
125
+ }, function (_result) {
126
+ return _exit ? _result : _await(fetch(jsonURL), function (resp) {
127
+ return _await(resp.json(), function (result) {
128
+ return typeof cb === 'function'
129
+ // eslint-disable-next-line promise/prefer-await-to-callbacks -- Old-style API
130
+ ? cb(result) : result;
131
+ // https://github.com/bcoe/c8/issues/135
132
+ /* c8 ignore next */
133
+ });
134
+ });
135
+ });
136
+ }, function (err) {
137
+ var e = /** @type {Error} */err;
138
+ e.message += " (File: ".concat(jsonURL, ")");
139
+ if (errBack) {
140
+ return errBack(e, jsonURL);
141
+ }
142
+ throw e;
143
+ // https://github.com/bcoe/c8/issues/135
144
+ /* c8 ignore next */
145
+ }));
146
+ /* c8 ignore next */
147
+ } catch (e) {
148
+ return Promise.reject(e);
149
+ }
150
+ };
151
+ }
152
+
153
+ var getJSON = buildGetJSONWithFetch();
154
+
155
+ return getJSON;
156
+
157
+ }));
158
+
159
+ } (dist$1));
160
+ return dist$1.exports;
159
161
  }
160
- const setDirname = _async$1$1(function () {
161
- return _invokeIgnored(function () {
162
- if (!dirname) {
163
- return _await$1$1(import('node:path'), function (_import) {
164
- ({
165
- dirname
166
- } = _import);
167
- });
168
- }
169
- });
170
- });
171
- function fixWindowsPath(path) {
172
- if (!isWindows) {
173
- isWindows = process.platform === 'win32';
174
- }
175
- return path.slice(
176
- // https://github.com/bcoe/c8/issues/135
177
- /* c8 ignore next */
178
- isWindows ? 1 : 0);
179
- }
180
-
181
- /**
182
- * @param {string} url
183
- * @returns {string}
184
- */
185
- function getDirectoryForURL(url) {
186
- // Node should be ok with this, but transpiling
187
- // to `require` doesn't work, so detect Windows
188
- // to remove slash instead
189
- // "file://" +
190
- return fixWindowsPath(dirname(new URL(url).pathname));
191
- }
192
-
193
- /* globals window, self -- Polyglot */
194
-
195
- /**
196
- * @typedef {(url: string) => Promise<Response>} SimpleFetch
197
- */
198
162
 
199
- /** @type {{default: SimpleFetch}} */
200
-
201
- function _await$3(value, then, direct) {
202
- if (!value || !value.then) {
203
- value = Promise.resolve(value);
204
- }
205
- return then ? value.then(then) : value;
206
- }
207
- let nodeFetch;
208
- /**
209
- * @param {object} [cfg]
210
- * @param {string} [cfg.baseURL]
211
- * @param {string|false} [cfg.cwd]
212
- * @returns {import('./buildGetJSONWithFetch.js').getJSONCallback}
213
- */
214
-
215
- function _invoke$2(body, then) {
216
- var result = body();
217
- if (result && result.then) {
218
- return result.then(then);
219
- }
220
- return then(result);
221
- }
222
- function _call(body, then, direct) {
223
- try {
224
- var result = Promise.resolve(body());
225
- return then ? result.then(then) : result;
226
- } catch (e) {
227
- return Promise.reject(e);
228
- }
229
- }
230
- function _async$2(f) {
231
- return function () {
232
- for (var args = [], i = 0; i < arguments.length; i++) {
233
- args[i] = arguments[i];
234
- }
235
- try {
236
- return Promise.resolve(f.apply(this, args));
237
- } catch (e) {
238
- return Promise.reject(e);
239
- }
240
- };
241
- }
242
- function buildGetJSON({
243
- baseURL,
244
- cwd: basePath
245
- } = {}) {
246
- const _fetch = typeof window !== 'undefined' || typeof self !== 'undefined' ? typeof window !== 'undefined' ? window.fetch : self.fetch
247
- // eslint-disable-next-line @stylistic/operator-linebreak -- TS
248
- :
249
- /**
250
- * @param {string} jsonURL
251
- * @returns {Promise<Response>}
252
- */
253
- _async$2(function (jsonURL) {
254
- let _exit = false;
255
- return _invoke$2(function () {
256
- if (/^https?:/u.test(jsonURL)) {
257
- return _invoke$2(function () {
258
- if (!nodeFetch) {
259
- return _await$3(import('node-fetch'), function (
260
- /** @type {{default: SimpleFetch}} */
261
- /** @type {unknown} */
262
- _import) {
263
- nodeFetch = _import;
264
- });
265
- }
266
- }, function () {
267
- const _nodeFetch$default = /** @type {SimpleFetch} */nodeFetch.default(jsonURL);
268
- _exit = true;
269
- return _nodeFetch$default;
270
- });
271
- }
272
- }, function (_result) {
273
- return _exit ? _result : _invoke$2(function () {
274
- if (!basePath) {
275
- return _call(setDirname, function () {
276
- basePath = baseURL ? getDirectoryForURL(baseURL) : typeof window === 'undefined' && process.cwd();
277
- });
278
- }
279
- }, function () {
280
- // Filed https://github.com/bergos/file-fetch/issues/12 to see
281
- // about getting relative basePaths in `file-fetch` and using
282
- // that better-tested package instead
283
- // @ts-expect-error Todo
284
- // Don't change to an import as won't resolve for browser testing
285
- // eslint-disable-next-line promise/avoid-new -- own API
286
- /* c8 ignore next */
287
- return _await$3(import('local-xmlhttprequest'), function (localXMLHttpRequest) {
288
- const XMLHttpRequest = /* eslint-disable jsdoc/valid-types -- Bug */
289
- /**
290
- * @type {{
291
- * prototype: XMLHttpRequest;
292
- * new(): XMLHttpRequest
293
- * }}
294
- */localXMLHttpRequest.default({
295
- /* eslint-enable jsdoc/valid-types -- Bug */
296
- basePath
297
- });
298
- return new Promise((resolve, reject) => {
299
- const r = new XMLHttpRequest();
300
- r.open('GET', jsonURL, true);
301
- // r.responseType = 'json';
302
- // eslint-disable-next-line unicorn/prefer-add-event-listener -- May not be available
303
- r.onreadystatechange = function () {
304
- // Not sure how to simulate `if`
305
- /* c8 ignore next 3 */
306
- if (r.readyState !== 4) {
307
- return;
308
- }
309
- if (r.status === 200) {
310
- // var json = r.json;
311
- const response = r.responseText;
312
- resolve(/** @type {Response} */{
313
- json: () => JSON.parse(response)
314
- });
315
- return;
316
- }
317
- reject(new SyntaxError('Failed to fetch URL: ' + jsonURL + 'state: ' + r.readyState + '; status: ' + r.status));
318
- };
319
- r.send();
320
- // https://github.com/bcoe/c8/issues/135
321
- /* c8 ignore next */
322
- });
323
- });
324
- });
325
- });
326
- });
327
- const ret = buildGetJSONWithFetch({
328
- fetch: _fetch
329
- });
330
- ret._fetch = _fetch;
331
- ret.hasURLBasePath = Boolean(baseURL);
332
- ret.basePath = basePath;
333
- return ret;
334
- }
335
- const getJSON = buildGetJSON();
163
+ var distExports = requireDist();
336
164
 
337
165
  function _iterableToArrayLimit(arr, i) {
338
166
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
@@ -3560,11 +3388,8 @@ const escapePlugin = ({pluginName, applicableField, targetLanguage}) => {
3560
3388
  * onByDefault: boolean,
3561
3389
  * meta: {
3562
3390
  * [key: string]: string
3563
- * },
3564
- * [args: string]: {}
3391
+ * }
3565
3392
  * }
3566
- * },
3567
- * [fieldArgs: string]: {
3568
3393
  * }
3569
3394
  * }} PluginFieldMappingForWork
3570
3395
  */
@@ -3609,7 +3434,7 @@ class PluginsForWork {
3609
3434
  * pluginName: string,
3610
3435
  * pluginLang: string,
3611
3436
  * onByDefaultDefault: boolean,
3612
- * meta: {}
3437
+ * meta: MetaValue
3613
3438
  * }) => void} cb
3614
3439
  * @returns {void}
3615
3440
  */
@@ -3767,7 +3592,9 @@ class PluginsForWork {
3767
3592
  * INCOMPLETE typing.
3768
3593
  * @typedef {{
3769
3594
  * "localization-strings": {
3770
- * [key: string]: {}
3595
+ * [key: string]: {
3596
+ * [key: string]: string
3597
+ * }
3771
3598
  * }
3772
3599
  * groups: FileGroup[],
3773
3600
  * plugins: {[key: string]: import('./Plugin.js').PluginInfo},
@@ -3794,7 +3621,7 @@ class PluginsForWork {
3794
3621
  * @returns {Promise<string[]>}
3795
3622
  */
3796
3623
  const getWorkFiles = async function getWorkFiles (files) {
3797
- const filesObj = /** @type {FilesObject} */ (await getJSON(files));
3624
+ const filesObj = /** @type {FilesObject} */ (await distExports.getJSON(files));
3798
3625
  const dataFiles = /** @type {string[]} */ ([]);
3799
3626
  filesObj.groups.forEach((fileGroup) => {
3800
3627
  fileGroup.files.forEach((fileData) => {
@@ -3868,12 +3695,14 @@ const getWorkData = async function ({
3868
3695
  lang, fallbackLanguages, work, files, allowPlugins, basePath,
3869
3696
  languages, preferredLocale
3870
3697
  }) {
3871
- const filesObj = /** @type {FilesObject} */ (await getJSON(files));
3698
+ const filesObj = /** @type {FilesObject} */ (await distExports.getJSON(files));
3872
3699
  const localizationStrings =
3873
3700
  /**
3874
3701
  * @type {{
3875
3702
  * "localization-strings": {
3876
- * [key: string]: {}
3703
+ * [key: string]: {
3704
+ * [key: string]: string
3705
+ * }
3877
3706
  * }
3878
3707
  * }}
3879
3708
  */ (
@@ -3895,7 +3724,6 @@ const getWorkData = async function ({
3895
3724
  return language in localizationStrings;
3896
3725
  });
3897
3726
  return {
3898
- // eslint-disable-next-line object-shorthand -- TS
3899
3727
  locale: /** @type {string} */ (locale),
3900
3728
  strings: {
3901
3729
  head: {},
@@ -4015,7 +3843,7 @@ const getWorkData = async function ({
4015
3843
  getPlugins
4016
3844
  ? Promise.all(
4017
3845
  pluginPaths.map(async (pluginPath) => {
4018
- // // eslint-disable-next-line no-unsanitized/method
3846
+ // eslint-disable-next-line no-unsanitized/method -- Through trusted plugins
4019
3847
  return /** @type {import('./Plugin.js').PluginObject} */ await (import(
4020
3848
  cwd +
4021
3849
  pluginPath
@@ -4079,22 +3907,18 @@ const getWorkData = async function ({
4079
3907
  );
4080
3908
  if (plugin.getTargetLanguage) {
4081
3909
  targetLanguage = plugin.getTargetLanguage({
4082
- // eslint-disable-next-line object-shorthand -- TS
4083
3910
  applicableField: /** @type {string} */ (applicableField),
4084
- // eslint-disable-next-line object-shorthand -- TS
4085
3911
  targetLanguage: /** @type {string} */ (targetLanguage),
4086
3912
  // Default lang for plug-in (from files.json)
4087
3913
  pluginLang,
4088
3914
  // Default lang when no target language or
4089
3915
  // plugin lang; using the lang of the applicable
4090
3916
  // field
4091
- // eslint-disable-next-line object-shorthand -- TS
4092
3917
  applicableFieldLang: /** @type {string} */ (applicableFieldLang)
4093
3918
  });
4094
3919
  }
4095
3920
  const field = escapePlugin({
4096
3921
  pluginName,
4097
- // eslint-disable-next-line object-shorthand -- TS
4098
3922
  applicableField: /** @type {string} */ (applicableField),
4099
3923
  targetLanguage: /** @type {string} */ (targetLanguage || pluginLang ||
4100
3924
  applicableFieldLang)
@@ -4109,13 +3933,10 @@ const getWorkData = async function ({
4109
3933
  ? plugin.getFieldAliasOrName({
4110
3934
  locales: lang,
4111
3935
  workI18n,
4112
- // eslint-disable-next-line object-shorthand -- TS
4113
3936
  targetLanguage: /** @type {string} */ (targetLanguage),
4114
- // eslint-disable-next-line object-shorthand -- TS
4115
3937
  applicableField: /** @type {string} */ (applicableField),
4116
3938
  applicableFieldI18N,
4117
3939
  meta,
4118
- // eslint-disable-next-line object-shorthand -- TS
4119
3940
  metaApplicableField:
4120
3941
  /**
4121
3942
  * @type {{
@@ -4131,13 +3952,10 @@ const getWorkData = async function ({
4131
3952
  pluginName,
4132
3953
  // locales: lang,
4133
3954
  workI18n,
4134
- // eslint-disable-next-line object-shorthand -- TS
4135
3955
  targetLanguage: /** @type {string} */ (targetLanguage),
4136
- // eslint-disable-next-line object-shorthand -- TS
4137
3956
  applicableFieldI18N: /** @type {string|string[]} */ (applicableFieldI18N),
4138
3957
  // Todo: Should have formal way to i18nize meta
4139
3958
  meta,
4140
- // eslint-disable-next-line object-shorthand -- TS
4141
3959
  metaApplicableField:
4142
3960
  /**
4143
3961
  * @type {{
@@ -4176,7 +3994,6 @@ const getWorkData = async function ({
4176
3994
  }
4177
3995
  return {
4178
3996
  // @ts-expect-error Ok
4179
- // eslint-disable-next-line object-shorthand -- TS
4180
3997
  fileData: /** @type {FileData} */ (fileData),
4181
3998
  workI18n, getFieldAliasOrName, metadataObj,
4182
3999
  schemaObj, schemaItems, fieldInfo,
@@ -2,7 +2,6 @@
2
2
  * @file Note that this should be kept as a polyglot client-server file
3
3
  * (besides the server, it is to be invoked by the project service worker).
4
4
  */
5
- /* eslint-env worker -- Worker environment */
6
5
 
7
6
  /**
8
7
  * @typedef {import('./utils/Metadata.js')} MetadataFile