File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
import JSON5 from ' json5' ;
3
+ import stringifyObject from ' stringify-object' ;
3
4
import type { UseValidationRule } from ' @/composable/validation' ;
4
5
import { isNotThrowing } from ' @/utils/boolean' ;
5
6
import { withDefaultOnError } from ' @/utils/defaults' ;
6
- import stringifyObject from " stringify-object"
7
-
8
- const transformer = (value : string ) => withDefaultOnError (() => stringifyObject (JSON5 .parse (value ), {
9
- indent: ' ' ,
10
- singleQuotes: false
11
- }), ' ' );
12
7
8
+ function transformer(value : string ) {
9
+ return withDefaultOnError (() => stringifyObject (JSON5 .parse (value ), {
10
+ indent: ' ' ,
11
+ singleQuotes: false ,
12
+ }), ' ' );
13
+ }
13
14
14
15
const rules: UseValidationRule <string >[] = [
15
16
{
@@ -28,4 +29,4 @@ const rules: UseValidationRule<string>[] = [
28
29
:input-validation-rules =" rules"
29
30
:transformer =" transformer"
30
31
/>
31
- </template >
32
+ </template >
You can’t perform that action at this time.
0 commit comments