File tree Expand file tree Collapse file tree 3 files changed +2
-10
lines changed
field-plugin/helpers/vite/src Expand file tree Collapse file tree 3 files changed +2
-10
lines changed Original file line number Diff line number Diff line change 1
1
import { existsSync , readFileSync } from 'fs'
2
2
import { resolve } from 'path'
3
- import { isEmpty , isOptionObject , isString } from './validation/manifest.ts'
3
+ import { isOptionObject , isString } from './validation/manifest.ts'
4
4
5
5
export const MANIFEST_FILE_NAME = 'field-plugin.config.json'
6
6
export const MANIFEST_FULL_PATH = resolve ( process . cwd ( ) , MANIFEST_FILE_NAME )
@@ -70,13 +70,6 @@ const validateOptions = (options: unknown[]): void => {
70
70
)
71
71
continue
72
72
}
73
-
74
- if ( isEmpty ( option . value ) ) {
75
- incorrectValues . push (
76
- `${ JSON . stringify ( option ) } --> Incorrect value. Must not be empty.` ,
77
- )
78
- continue
79
- }
80
73
}
81
74
82
75
if ( incorrectValues . length > 0 ) {
Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ import { ManifestOption } from '../manifest.ts'
2
2
3
3
export const isString = ( value : unknown ) => typeof value === 'string'
4
4
5
- export const isEmpty = ( value : string ) => value === ''
6
-
7
5
export const isOptionObject = ( option : unknown ) : option is ManifestOption =>
8
6
typeof option === 'object' &&
9
7
option !== null &&
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ const validateSchema = (manifest: Manifest): void => {
52
52
throw new Error ( `The 'options' property should be an array` )
53
53
}
54
54
55
+ //TODO: update this to use the new validation functions
55
56
manifest . options ?. forEach ( ( option ) => {
56
57
if ( ! ( 'name' in option && 'value' in option ) ) {
57
58
throw new Error (
You can’t perform that action at this time.
0 commit comments