@parca/utilities
Advanced tools
Comparing version 0.0.51 to 0.0.52
@@ -6,2 +6,6 @@ # Change Log | ||
## [0.0.52](https://github.com/parca-dev/parca/compare/@parca/utilities@0.0.51...@parca/utilities@0.0.52) (2024-01-22) | ||
**Note:** Version bump only for package @parca/utilities | ||
## [0.0.51](https://github.com/parca-dev/parca/compare/@parca/utilities@0.0.50...@parca/utilities@0.0.51) (2024-01-18) | ||
@@ -8,0 +12,0 @@ |
@@ -41,1 +41,2 @@ import { Label } from '@parca/client'; | ||
export declare const sanitizeHighlightedValues: (labels: Label[]) => Label[]; | ||
export declare const isUrlEncoded: (str: string) => boolean; |
@@ -98,3 +98,3 @@ // Copyright 2022 The Parca Authors | ||
if (encodeValues === true && (key === 'expression_a' || key === 'expression_b')) { | ||
values = values.map(value => encodeURIComponent(value)); | ||
values = values.map(value => (isUrlEncoded(value) ? value : encodeURIComponent(value))); | ||
} | ||
@@ -256,1 +256,9 @@ if (values.length > 1) { | ||
}); | ||
export const isUrlEncoded = (str) => { | ||
try { | ||
return decodeURIComponent(str) !== str; | ||
} | ||
catch (e) { | ||
return false; // Invalid encoding | ||
} | ||
}; |
{ | ||
"name": "@parca/utilities", | ||
"version": "0.0.51", | ||
"version": "0.0.52", | ||
"description": "A set of reusable functions for Parca", | ||
@@ -24,3 +24,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "052c29ba329322037a10badba3e8b1a395052e87" | ||
"gitHead": "fdf06a5203f54f1b5c7999520ae2f055f1f9dac7" | ||
} |
@@ -136,3 +136,3 @@ // Copyright 2022 The Parca Authors | ||
if (encodeValues === true && (key === 'expression_a' || key === 'expression_b')) { | ||
values = values.map(value => encodeURIComponent(value)); | ||
values = values.map(value => (isUrlEncoded(value) ? value : encodeURIComponent(value))); | ||
} | ||
@@ -341,1 +341,9 @@ | ||
}); | ||
export const isUrlEncoded = (str: string): boolean => { | ||
try { | ||
return decodeURIComponent(str) !== str; | ||
} catch (e) { | ||
return false; // Invalid encoding | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77752
1507