Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@swagger-api/apidom-json-pointer-relative
Advanced tools
Evaluate Relative JSON Pointer expressions against ApiDOM.
apidom-json-pointer-relative
is a package that evaluates Relative JSON Pointer against ApiDOM.
You can install this package via npm CLI by running the following command:
$ npm install @swagger-api/apidom-json-pointer-relative
import { ObjectElement } from '@swagger-api/apidom-core';
import { evaluate } from '@swagger-api/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')
Parses Relative JSON Pointer into AST (Abstract Syntax Tree).
import { parse } from '@swagger-api/apidom-json-pointer-relative';
const tokens = parse('2/foo/0');
// => { nonNegativeIntegerPrefix: 2, indexManipulation: undefined, jsonPointerTokens: ['foo', '0'], hashCharacter: false }
Compiles AST into Relative JSON Pointer.
import { compile } from '@swagger-api/apidom-json-pointer-relative';
const relativeJsonPointer = compile({
nonNegativeIntegerPrefix: 2,
indexManipulation: undefined,
jsonPointerTokens: ['highly', 'nested', 'objects'],
hashCharacter: false,
}); // => '2/highly/nested/objects'
If invalid Relative JSON Pointer is supplied to parse
or evaluate
functions, InvalidRelativeJsonPointerError
is thrown.
import { InvalidRelativeJsonPointerError } from '@swagger-api/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.
import { EvaluationRelativeJsonPointerError } from '@swagger-api/apidom-json-pointer-relative';
1.0.0-alpha.2 (2024-05-20)
FAQs
Evaluate Relative JSON Pointer expressions against ApiDOM.
The npm package @swagger-api/apidom-json-pointer-relative receives a total of 80 weekly downloads. As such, @swagger-api/apidom-json-pointer-relative popularity was classified as not popular.
We found that @swagger-api/apidom-json-pointer-relative demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.