@sentry/node
Version:
Sentry Node SDK using OpenTelemetry for performance instrumentation
26 lines (25 loc) • 1.11 kB
JavaScript
import { _INTERNAL_filterKeyValueData } from "@sentry/core";
// src/integrations/local-variables/common.ts
/**
* Filters captured frame variables by name according to a `dataCollection.stackFrameVariables` behavior.
*
* `true` keeps all variables (built-in sensitive names are still scrubbed), `false` drops them all, and the
* `{ allow: [...] }` / `{ deny: [...] }` forms filter by variable name.
*/
function filterFrameVariables(vars, behavior) {
return _INTERNAL_filterKeyValueData(vars, behavior);
}
/**
* The key used to store the local variables on the error object.
*/
const LOCAL_VARIABLES_KEY = "__SENTRY_ERROR_LOCAL_VARIABLES__";
/** Could this be an anonymous function? */
function isAnonymous(name) {
return name !== void 0 && (name.length === 0 || name === "?" || name === "<anonymous>");
}
/** Do the function names appear to match? */
function functionNamesMatch(a, b) {
return a === b || `Object.${a}` === b || a === `Object.${b}` || isAnonymous(a) && isAnonymous(b);
}
export { LOCAL_VARIABLES_KEY, filterFrameVariables, functionNamesMatch, isAnonymous };
//# sourceMappingURL=common.js.map