is-graph-pointer
v2.1.0
Published
Check what a graph pointer is pointing at
Downloads
9,661
Maintainers
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)