WikidataPain.Util()

Methods

static commonParameters(parameters, optionsnullable) → {Object}

Parameters:
Name Type Attributes Description
parameters Object
options Object <nullable>
Returns:
Object

static currentEntityId()nullable {string}

Get the entity-ID of the entity that's currently open.
Returns:
string

static entityIdFromClaimId(claimId) → {string}

Parameters:
Name Type Description
claimId string Wikidata claim-ID.
Returns:
string - Wikidata Q-ID which the claimId belongs to.

static filterAsync(array, callbackFn) → {Promise.<Array.<T>>}

Parameters:
Name Type Description
array Array.<T>
callbackFn function
Returns:
Promise.<Array.<T>>

static randomClaimId(entity) → {string}

Parameters:
Name Type Description
entity string Wikidata claim-ID.
Returns:
string

static randomEditGroup() → {string}

Returns a random ID which can be used from EditGroups.
Returns:
string

static randomUuidV4() → {string}

Random UUID which can be used as claim-id. Stolen from StackOverflow (of course): https://stackoverflow.com/a/2117523
Returns:
string

static undefinedToNull(value) → {T}

Parameters:
Name Type Description
value T
Returns:
T