open-index/open-npm huggingface dataset:
npm package: @speclynx/apidom-json-path
Description: Evaluate JSONPath expressions against ApiDOM.
Author: Vladimír Gorej
Latest version: 4.3.1

# @speclynx/apidom-json-path

`apidom-json-path` is a package that evaluates [JSONPath](https://www.rfc-editor.org/rfc/rfc9535.html) expressions against ApiDOM.

## Installation

You can install this package via [npm CLI](https://docs.npmjs.com/cli) by running the following command:

```sh
 $ npm install @speclynx/apidom-json-path
```

The API of this package is fully compliant with [RFC 9535](https://www.rfc-editor.org/rfc/rfc9535.html) and supports all aspects of JSONPath.
Uses [@swaggerexpert/jsonpath](https://www.npmjs.com/package/@swaggerexpert/jsonpath) under the hood and fully reflects its API.

Evaluation is contextual to ApiDOM realm (`ApiDOMEvaluationRealm`) - meaning `evaluate` function
expects only ApiDOM as the first argument.

```js
import { evaluate, ApiDOMEvaluationRealm } from '@speclynx/apidom-json-path';
```
npm package: @speclynx/apidom-json-pointer
Description: Evaluate JSON Pointer expressions against ApiDOM.
Author: Vladimír Gorej
Latest version: 4.3.1

# @speclynx/apidom-json-pointer

`apidom-json-pointer` is a package that evaluates [JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901) against ApiDOM.

## Installation

You can install this package via [npm CLI](https://docs.npmjs.com/cli) by running the following command:

```sh
 $ npm install @speclynx/apidom-json-pointer
```

The API of this package is fully compliant with [RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901) and supports all aspects of JSON Pointer.
Uses [@swaggerexpert/json-pointer](https://www.npmjs.com/package/@swaggerexpert/json-pointer) under the hood and fully reflects its API.

Evaluation is contextual to [ApiDOM realm](https://github.com/swaggerexpert/json-pointer?tab=readme-ov-file#apidom-evaluation-realm) - meaning `evaluate` function
expects only ApiDOM as the first argument.

```js
import { evaluate } from '@speclynx/apidom-json-pointer';
```
npm package: @speclynx/apidom-json-pointer-relative
Description: Evaluate Relative JSON Pointer expressions against ApiDOM.
Author: Vladimír Gorej
Latest version: 4.3.1

# @speclynx/apidom-json-pointer-relative

`apidom-json-pointer-relative` is a package that evaluates [Relative JSON Pointer](https://datatracker.ietf.org/doc/html/draft-bhutton-relative-json-pointer-00) against ApiDOM.

## Installation

You can install this package via [npm CLI](https://docs.npmjs.com/cli) by running the following command:

```sh
 $ npm install @speclynx/apidom-json-pointer-relative
```
## Evaluating

```js
import { ObjectElement } from '@speclynx/apidom-core';
import { evaluate } from '@speclynx/apidom-json-pointer-relative';

const root = new ObjectElement({ a: { b: 'c' } });
const current = root.get('a').get('b');
const result =  evaluate('0#', current, root);
// => StringElement('b')
```

## Parsing

Parses Relative JSON Pointer into AST (Abstract Syntax Tree).

```js
import { parse } from '@speclynx/apidom-json-pointer-relative';

const tokens = parse('2/foo/0');
// => { nonNegativeIntegerPrefix: 2, indexManipulation: undefined, jsonPointerTokens: ['foo', '0'], hashCharacter: false }
```

## Compiling

Compiles AST into Relative JSON Pointer.

```js
import { compile } from '@speclynx/apidom-json-pointer-relative';

const relativeJsonPointer = compile({
  nonNegativeIntegerPrefix: 2,
  indexManipulation: undefined,
  jsonPointerTokens: ['highly', 'nested', 'objects'],
  hashCharacter: false,
}); // => '2/highly/nested/objects'
```

## Invalid Relative JSON Pointers

If invalid Relative JSON Pointer is supplied to `parse` or `evaluate` functions, `InvalidRelativeJsonPointerError`
is thrown.

```js
import { InvalidRelativeJsonPointerError } from '@speclynx/apidom-json-pointer-relative';
```

If valid JSON Pointer is supplied to `evaluate` function and the relative pointer cannot be evaluated against
ApiDOM fragment, `EvaluationRelativeJsonPointerError` is thrown.

```js
import { EvaluationRelativeJsonPointerError } from '@speclynx/apidom-json-pointer-relative';
```