🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

json-transformer-cli

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-transformer-cli - npm Package Compare versions

Comparing version

to
1.0.4

23

lib/jsonpath-object-transform.js

@@ -6,19 +6,4 @@ /*jshint evil:true*/

'use strict';
// AMD
if (typeof define === 'function' && define.amd) {
define('jsonpathObjectTransform', ['JSONPath'], function(jsonPath) {
return (root.jsonpathObjectTransform = factory(jsonPath));
});
}
// Node
else if (typeof exports === 'object') {
module.exports = factory(require('JSONPath'));
}
// Browser global
else {
root.jsonpathObjectTransform = factory(root.jsonPath);
}
const {JSONPath} = require('jsonpath-plus');
module.exports = factory(JSONPath);
}(this, function(jsonPath) {

@@ -81,3 +66,3 @@ 'use strict';

pathStr = pathStr.substring(1, pathStr.length); // remove the extra dollar sign from the path
var seek = jsonPath.eval(data, pathStr) || [];
var seek = jsonPath({path: pathStr, json: data}) || [];
result[key] = seek.length ? seek[0] : undefined;

@@ -91,3 +76,3 @@ }

pathStr = pathStr.substring(1, pathStr.length); // remove the extra dollar sign from the path
var seek = jsonPath.eval(data, pathStr) || [];
var seek = jsonPath({path: pathStr, json: data}) || [];
result = seek.length ? seek[0] : undefined;

@@ -94,0 +79,0 @@ }

10

package.json

@@ -6,8 +6,5 @@ {

"dependencies": {
"JSONPath": "~0.11.2",
"jsonpath-plus": "~3.0.0",
"cli": "^1.0.1"
},
"bundledDependencies": [
"JSONPath"
],
"description": "A CLI tool to transform an object literal using JSONPath.",

@@ -34,5 +31,6 @@ "keywords": [

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"json-transform": "node cli.js"
},
"version": "1.0.3"
"version": "1.0.4"
}