Add ability to distinguish trapped entry point in json-prune

This commit is contained in:
Raymond Hill 2023-08-08 12:30:42 -04:00
parent 4f082a96bc
commit 2c04b5a982
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -1216,7 +1216,10 @@ function jsonPrune(
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
const logLevel = shouldLog(extraArgs);
const fetchPropNeedles = parsePropertiesToMatch(extraArgs.fetchPropsToMatch, 'url');
if ( fetchPropNeedles.size === 0 ) {
if (
fetchPropNeedles.size === 0 ||
matchObjectProperties(fetchPropNeedles, { url: 'undefined' })
) {
JSON.parse = new Proxy(JSON.parse, {
apply: function(target, thisArg, args) {
return objectPrune(