New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sagold/json-pointer

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sagold/json-pointer

json pointer - failsafe data retrieval on js or json objects

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

pointer

the json pointer implementation:

	var data = {
		parent: {
			child: {
				title: "title of child"
			}
		}
	}

	var titleOfChild = pointer.get(data, "#/parent/child/title"); // "title of child"

may also be used to apply values on an object:

	var data = {
		parent: {
			children: [
				{
					title: "title of child"
				}
			]
		}
	};

	pointer.set(data, "#/parent/children/1", {title: "second child"});

	console.log(data.parent.children.length); // 2

or to delete properties or array items

	pointer.delete(data, "#/parent/arrayOrObject/1");

Helpers

pointer.join joins all arguments to a valid json pointer:

	var key = "child";
	var target = pointer.join("parent", key, "title"); // "#/parent/child/title"

FAQs

Package last updated on 13 Nov 2016

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