Skip to content

Commit ecc310f

Browse files
committed
fix for long integers with double quotes
1 parent fefef65 commit ecc310f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/ConfigMapSecret/ConfigMapSecret.components.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,12 @@ export function ProtectedConfigMapSecretDetails({
677677
return selectedTab === 2 ? renderDiffView() : renderForm()
678678
}
679679

680-
export const convertToValidValue = (k: any): string => {
681-
if (k !== false && k !== true && k !== '' && !isNaN(Number(k))) {
682-
return Number(k).toString()
680+
export const convertToValidValue = (k: any): string => {
681+
if (k !== false && k !== true && k !== '' && !isNaN(Number(k))) {
682+
//Note: all long integers & floating values in "double quotes" with spaces will be handled in this check
683+
// eg val: "123678765678756764\n" or val: "1234.67856756787676\n" or "1276767634.67856\n" to trim down \n
684+
const replacePattern = /\s/g
685+
return k.toString().replace(replacePattern, '')
683686
}
684687
return k.toString()
685688
}

0 commit comments

Comments
 (0)