Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/json-pointer

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/json-pointer

TypeScript definitions for json-pointer

  • 1.0.34
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
441K
increased by61.78%
Maintainers
1
Weekly downloads
 
Created

What is @types/json-pointer?

@types/json-pointer provides TypeScript type definitions for the json-pointer library, which allows you to manipulate JSON data using JSON Pointers as defined in RFC 6901.

What are @types/json-pointer's main functionalities?

Get a value from a JSON object using a JSON Pointer

This feature allows you to retrieve a value from a JSON object using a JSON Pointer string.

const jsonPointer = require('json-pointer');
const obj = { foo: { bar: 'baz' } };
const value = jsonPointer.get(obj, '/foo/bar');
console.log(value); // 'baz'

Set a value in a JSON object using a JSON Pointer

This feature allows you to set a value in a JSON object at the location specified by a JSON Pointer string.

const jsonPointer = require('json-pointer');
const obj = { foo: { bar: 'baz' } };
jsonPointer.set(obj, '/foo/bar', 'qux');
console.log(obj.foo.bar); // 'qux'

Remove a value from a JSON object using a JSON Pointer

This feature allows you to remove a value from a JSON object at the location specified by a JSON Pointer string.

const jsonPointer = require('json-pointer');
const obj = { foo: { bar: 'baz' } };
jsonPointer.remove(obj, '/foo/bar');
console.log(obj.foo.bar); // undefined

Create a JSON Pointer from an array of tokens

This feature allows you to create a JSON Pointer string from an array of tokens.

const jsonPointer = require('json-pointer');
const pointer = jsonPointer.compile(['foo', 'bar']);
console.log(pointer); // '/foo/bar'

Parse a JSON Pointer into an array of tokens

This feature allows you to parse a JSON Pointer string into an array of tokens.

const jsonPointer = require('json-pointer');
const tokens = jsonPointer.parse('/foo/bar');
console.log(tokens); // ['foo', 'bar']

Other packages similar to @types/json-pointer

FAQs

Package last updated on 07 Nov 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