mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-29 16:16:02 +00:00
feat: stringify json
This commit is contained in:
@@ -15,7 +15,7 @@ import { FormikProps } from 'formik';
|
||||
import { ToolComponentProps } from '@tools/defineTool';
|
||||
import RadioWithTextField from '@components/options/RadioWithTextField';
|
||||
import SimpleRadio from '@components/options/SimpleRadio';
|
||||
import { isNumber } from '../../../../utils/string';
|
||||
import { isNumber, updateNumberField } from '../../../../utils/string';
|
||||
|
||||
type InitialValuesType = {
|
||||
indentationType: 'tab' | 'space';
|
||||
@@ -141,7 +141,7 @@ export default function PrettifyJson({ title }: ToolComponentProps) {
|
||||
value={values.spacesCount.toString()}
|
||||
onRadioClick={() => updateField('indentationType', 'space')}
|
||||
onTextChange={(val) =>
|
||||
isNumber(val) ? updateField('spacesCount', Number(val)) : null
|
||||
updateNumberField(val, 'spacesCount', updateField)
|
||||
}
|
||||
/>
|
||||
<SimpleRadio
|
||||
|
||||
Reference in New Issue
Block a user