forked from MapComplete/MapComplete
First steps to a real testing framework: first working version with mocha, chai and doctest-ts
This commit is contained in:
parent
edc366149b
commit
4f4fc650b1
42 changed files with 9032 additions and 9275 deletions
|
@ -41,6 +41,12 @@ export class Tag extends TagsFilter {
|
|||
return [`["${this.key}"="${this.value}"]`];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
const t = new Tag("key", "value")
|
||||
t.asHumanString() // => "key=value"
|
||||
t.asHumanString(true) // => "<a href='https://wiki.openstreetmap.org/wiki/Key:key' target='_blank'>key</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:key%3Dvalue' target='_blank'>value</a>"
|
||||
*/
|
||||
asHumanString(linkToWiki?: boolean, shorten?: boolean, currentProperties?: any) {
|
||||
let v = this.value;
|
||||
if (shorten) {
|
||||
|
|
|
@ -224,6 +224,11 @@ export default class Wikidata {
|
|||
return responses
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the 'key' segment from a URL
|
||||
*
|
||||
* Wikidata.ExtractKey("https://www.wikidata.org/wiki/Lexeme:L614072") // => "L614072"
|
||||
*/
|
||||
public static ExtractKey(value: string | number): string {
|
||||
if (typeof value === "number") {
|
||||
return "Q" + value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue