mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
11 lines
230 B
TypeScript
11 lines
230 B
TypeScript
export const convertToNumberIfPossible = (value: string | undefined) => {
|
|
if (typeof value === "undefined") {
|
|
return value;
|
|
}
|
|
const num = Number(value);
|
|
if (`${num}` === value) {
|
|
return num;
|
|
}
|
|
return value;
|
|
};
|