UNPKG

@ogcio/o11y-sdk-react

Version:

Opentelemetry standard instrumentation SDK for React based project

23 lines 707 B
/** * Checks whether a string contains URI-encoded components. * * @param {string} value - The string to inspect. * @returns {boolean} `true` if the string is encoded, `false` otherwise. */ export function _containsEncodedComponents(value) { try { const decodedURIComponent = decodeURIComponent(value); if (decodeURI(value) !== decodedURIComponent) { return true; } if (value !== decodedURIComponent) { return (encodeURIComponent(decodedURIComponent) === value || encodeURI(decodedURIComponent) === value); } } catch { return false; } return false; } //# sourceMappingURL=string-decoding.js.map