fix
This commit is contained in:
parent
2c8ad31ff0
commit
cee181caeb
@ -17,7 +17,8 @@ const { InteractiveOptions } = require ('./dist/lib/index.js');
|
|||||||
{ name: 'str', type: 'string', env: 'TEST_STR' },
|
{ name: 'str', type: 'string', env: 'TEST_STR' },
|
||||||
{ name: 'bool', type: 'boolean', env: 'TEST_BOOL' },
|
{ name: 'bool', type: 'boolean', env: 'TEST_BOOL' },
|
||||||
{ name: 'num', type: 'number', env: 'TEST_NUM' },
|
{ name: 'num', type: 'number', env: 'TEST_NUM' },
|
||||||
{ name: 'arr', type: 'array', env: 'TEST_ARR' }
|
{ name: 'arr', type: 'array', env: 'TEST_ARR' },
|
||||||
|
{ name: 'fld', type: 'folder', env: 'TEST_FOLDER' }
|
||||||
]);
|
]);
|
||||||
await reader.parse ();
|
await reader.parse ();
|
||||||
console.log (reader.serialize (true));
|
console.log (reader.serialize (true));
|
||||||
|
@ -13,6 +13,10 @@ export class PathType extends TypeValidation {
|
|||||||
return 'string';
|
return 'string';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get persistent_type (): 'string'|'number'|'boolean'|'array' {
|
||||||
|
return 'string';
|
||||||
|
}
|
||||||
|
|
||||||
public async to_type (value: unknown): Promise<unknown> {
|
public async to_type (value: unknown): Promise<unknown> {
|
||||||
if (typeof value !== 'string')
|
if (typeof value !== 'string')
|
||||||
throw new Error (`invalid type for ${this.option_type}`);
|
throw new Error (`invalid type for ${this.option_type}`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user