Export IntInput's parse and format functions
[arvados-workbench2.git] / src / views / run-process-panel / inputs / int-input.tsx
index 32ebeb75c27bc8ee6be8ed186b5051a5dcff0ab0..3273f35458c5e0aedd214ec838f60e7d4189592f 100644 (file)
@@ -22,9 +22,9 @@ export const IntInput = ({ input }: IntInputProps) =>
         format={format}
         validate={getValidation(input)} />;
 
-const parse = (value: any) => parseInt(value, 10);
+export const parse = (value: any) => value === '' ? '' : parseInt(value, 10);
 
-const format = (value: any) => isNaN(value) ? '' : JSON.stringify(value);
+export const format = (value: any) => isNaN(value) ? '' : JSON.stringify(value);
 
 const getValidation = memoize(
     (input: IntCommandInputParameter) => ([