textbrowser 0.48.0 → 0.48.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.
@@ -1,8 +1,8 @@
1
1
  const escapeHTML = (s) => {
2
2
  return !s
3
3
  ? ''
4
- : s.replace(/&/g, '&')
5
- .replace(/</g, '&lt;')
6
- .replace(/>/g, '&gt;');
4
+ : s.replaceAll('&', '&amp;').
5
+ replaceAll('<', '&lt;').
6
+ replaceAll('>', '&gt;');
7
7
  };
8
8
  export {escapeHTML};
@@ -31,15 +31,15 @@ export default async function workDisplay ({
31
31
  );
32
32
 
33
33
  async function _displayWork ({
34
- workI18n, metadataObj, getFieldAliasOrName, schemaObj, schemaItems,
34
+ workI18n, metadataObj, getFieldAliasOrName, schemaItems, // schemaObj,
35
35
  fieldInfo, metadata, pluginsForWork, groupsToWorks
36
36
  }) {
37
37
  const lParam = localizeParamNames
38
- ? key => l(['params', key])
39
- : key => key;
38
+ ? (key) => l(['params', key])
39
+ : (key) => key;
40
40
  const lIndexedParam = localizeParamNames
41
- ? key => l(['params', 'indexed', key])
42
- : key => key;
41
+ ? (key) => l(['params', 'indexed', key])
42
+ : (key) => key;
43
43
 
44
44
  // Returns element with localized option text (as Jamilih), with
45
45
  // optional fallback direction
@@ -56,15 +56,14 @@ export default async function workDisplay ({
56
56
  };
57
57
 
58
58
  // Returns plain text node or element (as Jamilih) with fallback direction
59
- const lDirectional = (key, substitutions) =>
60
- l(
61
- key,
62
- substitutions
63
- // formats
64
- // Restore if `intl-dom` supports
65
- // fallback: ({message}) =>
66
- // Templates.workDisplay.bdo({fallbackDirection, message})
67
- );
59
+ const lDirectional = (key, substitutions) => l(
60
+ key,
61
+ substitutions
62
+ // formats
63
+ // Restore if `intl-dom` supports
64
+ // fallback: ({message}) =>
65
+ // Templates.workDisplay.bdo({fallbackDirection, message})
66
+ );
68
67
 
69
68
  const fieldMatchesLocale = metadata.getFieldMatchesLocale({
70
69
  namespace: this.namespace,
@@ -19,8 +19,9 @@ export default async function workSelect ({
19
19
  const metadataObjs = await getJSON(works.groups.reduce((arr, fileGroup) => {
20
20
  const metadataBaseDir = (works.metadataBaseDirectory || '') +
21
21
  (fileGroup.metadataBaseDirectory || '') + '/';
22
- return fileGroup.files.reduce((ar, fileData) =>
23
- [...ar, metadataBaseDir + fileData.metadataFile],
22
+ return fileGroup.files.reduce((ar, fileData) => [
23
+ ...ar, metadataBaseDir + fileData.metadataFile
24
+ ],
24
25
  arr);
25
26
  }, []));
26
27
 
package/server/main.js CHANGED
@@ -7,7 +7,7 @@ import statik from '@brettz9/node-static';
7
7
  import fetch from 'node-fetch';
8
8
  import commandLineArgs from 'command-line-args';
9
9
  import DOMParser from 'dom-parser';
10
- import setGlobalVars from 'indexeddbshim/dist/indexeddbshim-UnicodeIdentifiers-node.js';
10
+ import setGlobalVars from 'indexeddbshim/dist/indexeddbshim-UnicodeIdentifiers-node.cjs';
11
11
  import {getJSON} from 'simple-get-json';
12
12
  import {setFetch} from 'intl-dom';
13
13
 
@@ -138,9 +138,11 @@ const srv = http.createServer(async (req, res) => {
138
138
  res,
139
139
  // For express, we'll first give a chance to other static servers
140
140
  // they might supply
141
- userParams.expressServer ? () => {
142
- // Empty
143
- } : next
141
+ userParams.expressServer
142
+ ? () => {
143
+ // Empty
144
+ }
145
+ : next
144
146
  );
145
147
  };
146
148
  if (userParams.expressServer) {