is-graph-pointer
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

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)

Package Sidebar

Install

npm i is-graph-pointer

Weekly Downloads

1,584

Version

2.1.0

License

MIT

Unpacked Size

5.18 kB

Total Files

5

Last publish

Collaborators

  • tpluscode