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

gson-query

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gson-query - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

8

lib/get.js

@@ -22,3 +22,3 @@ "use strict";

function queryGet(obj, jsonPointer, type) {
var matches = [];
var matches = type === queryGet.MAP ? {} : [];
var cb = getCbFactory(type, matches);

@@ -30,2 +30,3 @@ query(obj, jsonPointer, cb);

queryGet.ALL = "all";
queryGet.MAP = "map";
queryGet.POINTER = "pointer";

@@ -42,2 +43,7 @@ queryGet.VALUE = "value";

case queryGet.MAP:
return function cbGetAll(value, key, obj, pointer) {
matches[pointer] = value;
};
case queryGet.POINTER:

@@ -44,0 +50,0 @@ return function cbGetPointer(value, key, obj, pointer) {

2

package.json
{
"name": "gson-query",
"version": "1.0.5",
"version": "1.1.0",
"description": "json-pointer utilities for querying data",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -118,3 +118,3 @@ # Json Query

If you only require values or pointers, use queryGet to receive an Array as result:
If you only require values or pointers, use queryGet to receive an Array or Object as result:

@@ -130,2 +130,4 @@ ```js

var arrayOfAllFourArguments = queryGet(data, "#/**/id", queryGet.ALL);
// {"#/..": value, "#/..": value}
var mapOfPointersAndData = queryGet(data, "#/**/id", queryGet.MAP);
```

@@ -132,0 +134,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