JSPM

@criteria/json-pointer

0.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19607
  • Score
    100M100P100Q149517F
  • License MIT

Implementation of JSON Pointer (RFC 6901).

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-pointer

Usage

Evaluate a JSON Pointer:

import { evaluateJSONPointer } from '@criteria/json-pointer'

const str = '#/foo'
const document = {
    foo: true
}

const value = evaluateJSONPointer(str, document)
// value === true

Validate that a string is a JSON Pointer:

import { validateJSONPointer } from '@criteria/json-pointer'

const str = '#/foo'

try {
  validateJSONPointer(str)
  // valid
} catch (err) {
  // not valid
}