Package Exports
- @criteria/json-pointer
- @criteria/json-pointer/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@criteria/json-pointer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
JSON Pointer
Implementation of JSON Pointer (RFC 6901).
Installation
npm install @criteria/json-pointerUsage
Evaluate a JSON Pointer:
import { evaluateJSONPointer } from '@criteria/json-pointer'
const str = '#/foo'
const document = {
    foo: true
}
const value = evaluateJSONPointer(str, document)
// value === trueValidate that a string is a JSON Pointer:
import { validateJSONPointer } from '@criteria/json-pointer'
const str = '#/foo'
try {
  validateJSONPointer(str)
  // valid
} catch (err) {
  // not valid
}