Socket
Socket
Sign inDemoInstall

@swagger-api/apidom-json-pointer

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swagger-api/apidom-json-pointer

Evaluate JSON Pointer expressions against ApiDOM.


Version published
Weekly downloads
354K
decreased by-20.35%
Maintainers
1
Weekly downloads
 
Created

What is @swagger-api/apidom-json-pointer?

@swagger-api/apidom-json-pointer is an npm package that provides utilities for working with JSON Pointers, which are a way to reference specific parts of a JSON document. This package is particularly useful for navigating and manipulating JSON data structures in a standardized way.

What are @swagger-api/apidom-json-pointer's main functionalities?

Creating JSON Pointers

This feature allows you to create a JSON Pointer instance from a string. The created pointer can then be used to reference specific parts of a JSON document.

const { JsonPointer } = require('@swagger-api/apidom-json-pointer');
const pointer = JsonPointer.create('/path/to/element');
console.log(pointer.toString()); // Outputs: /path/to/element

Resolving JSON Pointers

This feature allows you to resolve a JSON Pointer against a JSON document to retrieve the value at the specified location.

const { JsonPointer } = require('@swagger-api/apidom-json-pointer');
const document = { path: { to: { element: 'value' } } };
const pointer = JsonPointer.create('/path/to/element');
const value = pointer.resolve(document);
console.log(value); // Outputs: 'value'

Setting Values with JSON Pointers

This feature allows you to set a value at a specific location in a JSON document using a JSON Pointer.

const { JsonPointer } = require('@swagger-api/apidom-json-pointer');
const document = { path: { to: { element: 'value' } } };
const pointer = JsonPointer.create('/path/to/element');
pointer.set(document, 'newValue');
console.log(document.path.to.element); // Outputs: 'newValue'

Other packages similar to @swagger-api/apidom-json-pointer

FAQs

Package last updated on 28 Feb 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc