Files
David Hérault aa6bef3ac8 use strict
2017-01-05 15:50:05 +01:00

17 lines
393 B
JavaScript

'use strict';
const jsonPathPlus = require('jsonpath-plus');
const debugLog = require('./debugLog');
/*
Just a wrapper around an external dependency for debugging purposes
*/
module.exports = function jsonPath(json, path) {
debugLog('Calling jsonPath:', path);
const result = jsonPathPlus({ json, path, wrap: true })[0];
debugLog('jsonPath resolved:', result);
return result;
};