UNPKG

@segment/analytics-next

Version:

Analytics Next (aka Analytics 2.0) is the latest version of Segment’s JavaScript SDK - enabling you to send your data to any tool without having to learn, test, or use a new API every time.

20 lines 693 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.gracefulDecodeURIComponent = void 0; /** * Tries to gets the unencoded version of an encoded component of a * Uniform Resource Identifier (URI). If input string is malformed, * returns it back as-is. * * Note: All occurences of the `+` character become ` ` (spaces). **/ function gracefulDecodeURIComponent(encodedURIComponent) { try { return decodeURIComponent(encodedURIComponent.replace(/\+/g, ' ')); } catch (_a) { return encodedURIComponent; } } exports.gracefulDecodeURIComponent = gracefulDecodeURIComponent; //# sourceMappingURL=gracefulDecodeURIComponent.js.map