@bhsd/codemirror-mediawiki 2.19.6 → 2.19.8

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/mwConfig.mjs CHANGED
@@ -10,33 +10,35 @@ var setObject = (key, value) => {
10
10
  };
11
11
 
12
12
  // src/static.ts
13
- var fromEntries = (entries, obj, string) => {
14
- for (const entry of entries) {
15
- obj[entry] = string ? entry : true;
16
- }
17
- };
18
- var getStaticMwConfig = ({ parserFunction, protocol, nsid, variants, redirection, ext, doubleUnderscore, img }, modes) => {
19
- const mwConfig = {
20
- tags: {},
21
- tagModes: modes,
22
- doubleUnderscore: [{}, {}],
23
- functionSynonyms: [parserFunction[0], {}],
24
- urlProtocols: `${protocol}|//`,
25
- nsid,
26
- img: Object.fromEntries(Object.entries(img).map(([key, val]) => [key, `img_${val}`])),
27
- variants,
28
- redirection
29
- }, [insensitive, , obj] = doubleUnderscore;
30
- fromEntries(ext, mwConfig.tags);
31
- fromEntries(
32
- (obj && insensitive.length === 0 ? Object.keys(obj) : insensitive).map((s) => `__${s}__`),
33
- mwConfig.doubleUnderscore[0]
34
- );
35
- fromEntries(doubleUnderscore[1].map((s) => `__${s}__`), mwConfig.doubleUnderscore[1]);
36
- fromEntries(parserFunction.slice(2).flat(), mwConfig.functionSynonyms[0], true);
37
- fromEntries(parserFunction[1], mwConfig.functionSynonyms[1]);
38
- return mwConfig;
39
- };
13
+ var getStaticMwConfig = ({
14
+ parserFunction: [p0, p1, ...p2],
15
+ protocol,
16
+ nsid,
17
+ variants,
18
+ redirection,
19
+ ext,
20
+ doubleUnderscore: [d0, d1, d2],
21
+ img
22
+ }, modes) => ({
23
+ tags: Object.fromEntries(ext.map((s) => [s, true])),
24
+ tagModes: modes,
25
+ doubleUnderscore: [
26
+ Object.fromEntries((d2 && d0.length === 0 ? Object.keys(d2) : d0).map((s) => [`__${s}__`, true])),
27
+ Object.fromEntries(d1.map((s) => [`__${s}__`, true]))
28
+ ],
29
+ functionSynonyms: [
30
+ {
31
+ ...p0,
32
+ ...Object.fromEntries(p2.flat().map((s) => [s, s]))
33
+ },
34
+ Object.fromEntries(p1.map((s) => [s, true]))
35
+ ],
36
+ urlProtocols: `${protocol}|//`,
37
+ nsid,
38
+ img: Object.fromEntries(Object.entries(img).map(([k, v]) => [k, `img_${v}`])),
39
+ variants,
40
+ redirection
41
+ });
40
42
 
41
43
  // mw/config.ts
42
44
  var _a;
package/dist/static.d.ts CHANGED
@@ -24,4 +24,4 @@ export declare const tagModes: {
24
24
  maplink: string;
25
25
  graph: string;
26
26
  };
27
- export declare const getStaticMwConfig: ({ parserFunction, protocol, nsid, variants, redirection, ext, doubleUnderscore, img }: Config, modes: Record<string, string>) => MwConfig;
27
+ export declare const getStaticMwConfig: ({ parserFunction: [p0, p1, ...p2], protocol, nsid, variants, redirection, ext, doubleUnderscore: [d0, d1, d2], img, }: Config, modes: Record<string, string>) => MwConfig;