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

json-ptr

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-ptr - npm Package Compare versions

Comparing version 1.2.1-ts.64a7978.0 to 1.2.1-ts.93dc79c.0

66

package.json
{
"name": "json-ptr",
"version": "1.2.1-ts.64a7978.0",
"version": "1.2.1-ts.93dc79c.0",
"author": "Phillip Clark <phillip@flitbit.com>",

@@ -14,2 +14,6 @@ "description": "A complete implementation of JSON Pointer (RFC 6901) for nodejs and modern browsers.",

"types": "dist/index.d.ts",
"files": [
"dist",
"dist.browser"
],
"license": "MIT",

@@ -21,36 +25,38 @@ "repository": {

"scripts": {
"build": "tsc --build tsconfig.json",
"clean": "rimraf dist .nyc_output coverage",
"lint": "eslint src --ext .js,.ts,.json",
"preversion": "npm run build",
"clean": "rimraf coverage dist dist.browser tmp",
"prebuild": "npm run lint",
"pretest": "npm run build",
"test": "nyc mocha src/**/*.spec.ts",
"ci": "npm run test",
"docs": "typedoc"
"build:browser": "webpack",
"build:browser-tests": "webpack --config webpack.tests.config.js",
"build": "tsc -p tsconfig.release.json && npm run build:browser && npm run build:browser-tests",
"build:watch": "tsc -w -p tsconfig.release.json",
"lint": "eslint . --ext .ts,.tsx",
"pretest": "npm run lint",
"test": "nyc mocha __tests__/**/*.spec.ts",
"test:watch": "chokidar \"*.js\" \"*.json\" \"src/**/*.ts\" \"__tests__/**/*.ts\" --command \"npm run test\" --initial",
"ci": "npm run test && npm run test"
},
"devDependencies": {
"@types/assert-plus": "^1.0.4",
"@types/bent": "^7.0.1",
"@types/chai": "^4.2.9",
"@types/mocha": "^7.0.1",
"@typescript-eslint/eslint-plugin": "^2.19.2",
"@typescript-eslint/parser": "^2.19.2",
"bent": "^7.0.6",
"@types/bent": "^7.0.2",
"@types/chai": "^4.2.11",
"@types/debug": "^4.1.5",
"@types/mocha": "^7.0.2",
"@types/node": "~14.0.19",
"@typescript-eslint/eslint-plugin": "~3.6.0",
"@typescript-eslint/parser": "~3.6.0",
"bent": "^7.3.7",
"chai": "^4.2.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-json": "^2.0.1",
"eslint-plugin-mocha": "^6.2.2",
"eslint-plugin-prettier": "^3.1.2",
"lodash": "^4.17.15",
"mocha": "^7.0.1",
"nyc": "^15.0.0",
"prettier": "^1.19.1",
"rimraf": "^3.0.2",
"source-map-support": "^0.5.16",
"ts-node": "^8.6.2",
"typedoc": "^0.16.10",
"typescript": "^3.7.5"
"chokidar-cli": "^2.1.0",
"eslint": "^7.4.0",
"eslint-config-prettier": "~6.11.0",
"eslint-plugin-mocha": "^7.0.1",
"mocha": "^8.0.1",
"nyc": "^15.1.0",
"prettier": "~2.0.5",
"rimraf": "~3.0.2",
"ts-loader": "^7.0.5",
"ts-node": "^8.10.2",
"typescript": "~3.9.6",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
},

@@ -57,0 +63,0 @@ "nyc": {

@@ -163,2 +163,40 @@ # json-ptr

#### .unset(target, pointer)
Unsets the `value` at the specified `pointer` on the `target` and returns the value. The default behavior is to do nothing if `pointer` is nonexistent.
_arguments:_
* `target` : _object, required_ &ndash; the target object
* `pointer` : _string, required_ &ndash; a JSON pointer in [JSON string representation](https://tools.ietf.org/html/rfc6901#section-5) or [URI fragment identifier representation](https://tools.ietf.org/html/rfc6901#section-6)
_returns:_
* The dereferenced value or _undefined_ if nonexistent
_example:_
```javascript
var prior = ptr.unset(data, '#/legumes/1/instock');
```
example force:
```javascript
var data = {};
ptr.unset(data, '#/peter/piper');
ptr.unset(data, '#/peter/pan');
console.log(JSON.stringify(data, null, ' '));
```
```json
{
"peter": {
"pickle": "dunno"
}
}
```
#### .list(target, fragmentId)

@@ -165,0 +203,0 @@

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