mediawiki-projects-list 2.3.3 → 2.3.5

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/index.js CHANGED
@@ -100,19 +100,21 @@ function inputToWikiProject(input) {
100
100
  let scriptPath = ( wikiProject.regexPaths ? '/' : wikiProject.scriptPath ).replace(/[.*+?^${}()|\[\]\\]/g, '\\$&');
101
101
  let regex = input.match( new RegExp( wikiProject.regex + `(?:${articlePath}|${scriptPath}|/?$)` ) );
102
102
  if ( regex ) {
103
+ scriptPath = wikiProject.scriptPath;
104
+ articlePath = wikiProject.articlePath;
103
105
  if ( wikiProject.regexPaths ) {
104
- scriptPath = wikiProject.scriptPath.replace( /\$(\d)/g, (match, n) => regex[n] );
105
- articlePath = wikiProject.articlePath.replace( /\$(\d)/g, (match, n) => regex[n] );
106
+ scriptPath = scriptPath.replace( /\$(\d)/g, (match, n) => regex[n] );
107
+ articlePath = articlePath.replace( /\$(\d)/g, (match, n) => regex[n] );
106
108
  }
109
+ if ( articlePath.includes('?') && !articlePath.endsWith('=') ) {
110
+ articlePath = articlePath.replace( '?', '$1?' );
111
+ }
112
+ else articlePath += '$1';
107
113
  result = {
108
114
  fullArticlePath: 'https://' + regex[1] + articlePath,
109
115
  fullScriptPath: 'https://' + regex[1] + scriptPath,
110
116
  wikiProject: wikiProject
111
117
  };
112
- if ( result.fullArticlePath.includes('?') && !result.fullArticlePath.endsWith('=') ) {
113
- result.fullArticlePath = result.fullArticlePath.replace( '?', '$1?' );
114
- }
115
- else result.fullArticlePath += '$1';
116
118
  }
117
119
  }
118
120
  functionCache.inputToWikiProject.set(input, result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediawiki-projects-list",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "type": "commonjs",
5
5
  "description": "List of MediaWiki projects for use in discord-wiki-bot",
6
6
  "main": "index.js",
package/projects.json CHANGED
@@ -393,6 +393,13 @@
393
393
  ]
394
394
  }
395
395
  },
396
+ {
397
+ "name": "fallout.wiki",
398
+ "regex": "(fallout\\.wiki)",
399
+ "articlePath": "/wiki/",
400
+ "scriptPath": "/",
401
+ "fullScriptPath": "https://fallout.wiki/"
402
+ },
396
403
  {
397
404
  "name": "fallout-wiki.com",
398
405
  "regex": "((?:www\\.)?fallout-wiki\\.com)",
@@ -1257,13 +1264,6 @@
1257
1264
  "scriptPath": "/",
1258
1265
  "fullScriptPath": "https://wiki.halo.fr/"
1259
1266
  },
1260
- {
1261
- "name": "glitchtale.com",
1262
- "regex": "((?:www\\.)?glitchtale\\.com)",
1263
- "articlePath": "/wiki/index.php/",
1264
- "scriptPath": "/wiki/",
1265
- "fullScriptPath": "https://glitchtale.com/wiki/"
1266
- },
1267
1267
  {
1268
1268
  "name": "wiki.therofl98.co",
1269
1269
  "regex": "(wiki\\.therofl98\\.co)",