Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tpluscode/is-graph-pointer
Check what a graph pointer is pointing at
https://github.com/tpluscode/is-graph-pointer
Last synced: 6 days ago
JSON representation
Check what a graph pointer is pointing at
- Host: GitHub
- URL: https://github.com/tpluscode/is-graph-pointer
- Owner: tpluscode
- License: mit
- Created: 2022-01-31T20:54:21.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-27T22:06:33.000Z (about 1 year ago)
- Last Synced: 2024-12-01T17:56:50.268Z (23 days ago)
- Language: TypeScript
- Size: 633 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# is-graph-pointer
Check what a graph pointer is pointing at
In an `if` condition:
```typescript
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:
```typescript
import type { MultiPointer } from 'clownface'
import type { Literal } from '@rdfjs/types'
import { isLiteral } from 'is-graph-pointer'let pointer: MultiPointer
const literals: MultiPointer = pointer.filter(isLiteral)
```