mediawiki-projects-list 2.3.2 → 2.3.4

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.2",
3
+ "version": "2.3.4",
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
@@ -349,6 +349,16 @@
349
349
  "OAuth"
350
350
  ]
351
351
  },
352
+ {
353
+ "name": "zeldapedia.wiki",
354
+ "regex": "((?:www\\.)?zeldapedia\\.wiki)",
355
+ "articlePath": "/wiki/",
356
+ "scriptPath": "/w/",
357
+ "fullScriptPath": "https://zeldapedia.wiki/w/",
358
+ "extensions": [
359
+ "Cargo"
360
+ ]
361
+ },
352
362
  {
353
363
  "name": "bulbagarden.net",
354
364
  "regex": "((bulbapedia|archives|bulbanews)\\.bulbagarden\\.net)",