mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-06 00:44:57 +05:30
fix: min indent spaces set to 1 (thrown error when 0)
This commit is contained in:
parent
0da3189eb3
commit
adf72108c6
2 changed files with 4 additions and 1 deletions
|
|
@ -178,7 +178,7 @@ export default function CsvToYaml({
|
|||
value={values.spaces}
|
||||
type="number"
|
||||
onOwnChange={(val) => updateField('spaces', Number(val))}
|
||||
inputProps={{ min: 0 }}
|
||||
inputProps={{ min: 1 }}
|
||||
description={
|
||||
'Set the number of spaces to use for YAML indentation.'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ function toYaml(
|
|||
input: Record<string, string>[] | string[][],
|
||||
indentSpaces: number = 2
|
||||
): string {
|
||||
if (indentSpaces == 0) {
|
||||
throw new Error('Indent spaces must be greater than zero');
|
||||
}
|
||||
const indent = ' '.repeat(indentSpaces);
|
||||
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue