How to use the wikibase-sdk.claim function in wikibase-sdk

To help you get started, we’ve selected a few wikibase-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maxlath / wikibase-edit / lib / claim / find_snak.js View on Github external
const sameValue = (datatype, snak, value) => {
  if (value.snaktype && value.snaktype !== 'value') {
    return snak.snaktype === value.snaktype
  }
  const snakValue = simplifyClaim(snak)
  const comparator = valueComparators[datatype]
  if (comparator) {
    return comparator(snak, snakValue, value)
  } else {
    return snakValue === value
  }
}
github maxlath / wikibase-edit / lib / claim / claim_parsers.js View on Github external
matchClaim: value => claim => {
    if (typeof value === 'object') {
      if (hasSpecialSnaktype(value)) {
        if (claim.mainsnak.snaktype === value.snaktype) return true
      }
      value = value.value
    }
    return value === simplifyClaim(claim)
  },
  getGuid: claim => claim.id