forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
14b2799f08
commit
4add2d1aff
151 changed files with 4561 additions and 3315 deletions
|
|
@ -42,8 +42,10 @@ export default class WikidataValidator extends Validator {
|
|||
"notInstanceof",
|
||||
"A list of Q-identifiers which indicates that the search results _must not_ be an entity of this type, e.g. [`Q79007`](https://www.wikidata.org/wiki/Q79007) to filter away all streets from the search results",
|
||||
],
|
||||
["multiple",
|
||||
"If 'yes' or 'true', will allow to select multiple values at once"]
|
||||
[
|
||||
"multiple",
|
||||
"If 'yes' or 'true', will allow to select multiple values at once",
|
||||
],
|
||||
]
|
||||
),
|
||||
]),
|
||||
|
|
@ -145,7 +147,12 @@ Another example is to search for species and trees:
|
|||
* WikidataValidator.removePostAndPrefixes("Elf-Julistraat", [], {"nl":["straat", "laan"], "en": ["street"]}, "nl") // => "Elf-Juli"
|
||||
* WikidataValidator.removePostAndPrefixes("Elf-Julistraat", [], {"nl":["straat", "laan"], "en": ["street"]}, "en") // => "Elf-Julistraat"
|
||||
*/
|
||||
public static removePostAndPrefixes(searchTerm: string, prefixesToRemove: string[] | Record<string, string[]>, postfixesToRemove: string[] | Record<string, string[]>, language: string): string {
|
||||
public static removePostAndPrefixes(
|
||||
searchTerm: string,
|
||||
prefixesToRemove: string[] | Record<string, string[]>,
|
||||
postfixesToRemove: string[] | Record<string, string[]>,
|
||||
language: string
|
||||
): string {
|
||||
const prefixes = prefixesToRemove
|
||||
const postfixes = postfixesToRemove
|
||||
const prefixesUnwrapped: RegExp[] = (
|
||||
|
|
@ -156,7 +163,6 @@ Another example is to search for species and trees:
|
|||
Array.isArray(postfixes) ? postfixes : postfixes[language] ?? []
|
||||
).map((s) => new RegExp(s + "$", "i"))
|
||||
|
||||
|
||||
let clipped = searchTerm.trim()
|
||||
|
||||
for (const postfix of postfixesUnwrapped) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue