Package detail

is-graph-pointer

tpluscode11kMIT2.1.0

Check what a graph pointer is pointing at

clownface, graph pointer, rdf/js

readme

is-graph-pointer

Check what a graph pointer is pointing at

In an if condition:

import type { GraphPointer } from 'clownface'
import type { NamedNode } from '@rdfjs/types'
import { isNamedNode } from 'is-graph-pointer'

let pointer: GraphPointer

if (isNamedNode(pointer)) {
  const term: NamedNode = pointer.term
}

To filter arrays:

import type { MultiPointer } from 'clownface'
import type { Literal } from '@rdfjs/types'
import { isLiteral } from 'is-graph-pointer'

let pointer: MultiPointer

const literals: MultiPointer<Literal> = pointer.filter(isLiteral)

changelog

is-graph-pointer

2.1.0

Minor Changes

  • c8e6054: Update clownface to v2

2.0.0

Major Changes

  • dbb7ee8: The package is now ESM-only

1.3.0

Minor Changes

  • 8845494: Add second argument to isLiteral to allow matching datatype and language (exact)

1.2.2

Patch Changes

  • beda645: When filtering an array of pointer, the term type would not be correctly inferred

1.2.1

Patch Changes

  • 15fdd45: The package would fail to import in webpack

1.2.0

Minor Changes

  • 0efaf74: Added isGraphPointer function

1.1.0

Minor Changes

  • 43827a1: Functions would not handle undefined pointer

1.0.1

Patch Changes

  • 2270c33: Missing declarations in package

1.0.0

Major Changes

  • 3a0997e: First version