mediawiki-projects-list 2.3.6 → 3.0.0

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
@@ -98,7 +98,7 @@ function inputToWikiProject(input) {
98
98
  if ( wikiProject ) {
99
99
  let articlePath = ( wikiProject.regexPaths ? '/' : wikiProject.articlePath.split('?')[0] ).replace(/[.*+?^${}()|\[\]\\]/g, '\\$&');
100
100
  let scriptPath = ( wikiProject.regexPaths ? '/' : wikiProject.scriptPath ).replace(/[.*+?^${}()|\[\]\\]/g, '\\$&');
101
- let regex = input.match( new RegExp( wikiProject.regex + `(?:${articlePath}|${scriptPath}|/?$)` ) );
101
+ let regex = input.match( new RegExp( '(?:[\\w%]+(?::[\\w%]+)?@)?' + wikiProject.regex + `(?:${articlePath}|${scriptPath}|/?$)`, 'd' ) );
102
102
  if ( regex ) {
103
103
  scriptPath = wikiProject.scriptPath;
104
104
  articlePath = wikiProject.articlePath;
@@ -110,9 +110,13 @@ function inputToWikiProject(input) {
110
110
  articlePath = articlePath.replace( '?', '$1?' );
111
111
  }
112
112
  else articlePath += '$1';
113
+ let auth = '';
114
+ if ( regex.index < regex.indices[1][0] ) {
115
+ auth = input.slice(regex.index, regex.indices[1][0]);
116
+ }
113
117
  result = {
114
118
  fullArticlePath: 'https://' + regex[1] + articlePath,
115
- fullScriptPath: 'https://' + regex[1] + scriptPath,
119
+ fullScriptPath: 'https://' + auth + regex[1] + scriptPath,
116
120
  wikiProject: wikiProject
117
121
  };
118
122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediawiki-projects-list",
3
- "version": "2.3.6",
3
+ "version": "3.0.0",
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
@@ -1887,6 +1887,13 @@
1887
1887
  "scriptPath": "/",
1888
1888
  "fullScriptPath": "https://anothereden.wiki/"
1889
1889
  },
1890
+ {
1891
+ "name": "miki.community",
1892
+ "regex": "((?:en\\.)?miki\\.community)",
1893
+ "articlePath": "/wiki/",
1894
+ "scriptPath": "/w/",
1895
+ "fullScriptPath": "https://en.miki.community/w/"
1896
+ },
1890
1897
  {
1891
1898
  "name": "bluearchive.wiki",
1892
1899
  "regex": "(bluearchive\\.wiki)",
@@ -1941,6 +1948,48 @@
1941
1948
  "scriptPath": "/",
1942
1949
  "fullScriptPath": "https://tot.wiki/"
1943
1950
  },
1951
+ {
1952
+ "name": "minecove.net",
1953
+ "regex": "((?:www\\.)?minecove\\.net)",
1954
+ "articlePath": "/wiki/",
1955
+ "scriptPath": "/w/",
1956
+ "fullScriptPath": "https://minecove.net/w/"
1957
+ },
1958
+ {
1959
+ "name": "x-journal.net",
1960
+ "regex": "((?:www\\.)?x-journal\\.net)",
1961
+ "articlePath": "/Wiki/index.php?title=",
1962
+ "scriptPath": "/Wiki/",
1963
+ "fullScriptPath": "https://x-journal.net/Wiki/"
1964
+ },
1965
+ {
1966
+ "name": "wiki.producers-and-traders.de",
1967
+ "regex": "(wiki\\.producers-and-traders\\.de)",
1968
+ "articlePath": "/index.php?title=",
1969
+ "scriptPath": "/",
1970
+ "fullScriptPath": "https://wiki.producers-and-traders.de/"
1971
+ },
1972
+ {
1973
+ "name": "wiki.kynseed.com",
1974
+ "regex": "(wiki\\.kynseed\\.com)",
1975
+ "articlePath": "/wiki/",
1976
+ "scriptPath": "/",
1977
+ "fullScriptPath": "https://wiki.kynseed.com/"
1978
+ },
1979
+ {
1980
+ "name": "wiki.rinkofhonor.com",
1981
+ "regex": "(wiki\\.rinkofhonor\\.com)",
1982
+ "articlePath": "/index.php/",
1983
+ "scriptPath": "/",
1984
+ "fullScriptPath": "https://wiki.rinkofhonor.com/"
1985
+ },
1986
+ {
1987
+ "name": "wiki.insanityflyff.com",
1988
+ "regex": "(wiki\\.insanityflyff\\.com)",
1989
+ "articlePath": "/index.php/",
1990
+ "scriptPath": "/",
1991
+ "fullScriptPath": "https://wiki.insanityflyff.com/"
1992
+ },
1944
1993
  {
1945
1994
  "name": "liquipedia.net",
1946
1995
  "regex": "((?:www\\.)?liquipedia\\.net/([a-z\\d]{1,50}))",