mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
exmode: Give build-time error on bad arg types
This commit is contained in:
parent
927e19c818
commit
58ed23913d
2 changed files with 4 additions and 1 deletions
|
@ -38,6 +38,8 @@ class Signature:
|
|||
# Type declaration
|
||||
if ':' in param:
|
||||
name, typ = map(str.strip, param.split(':'))
|
||||
if typ not in ('number', 'boolean', 'string', 'string[]', 'ModeName') and '|' not in typ:
|
||||
raise Exception("Edit me! " + typ + " is not a supported type!")
|
||||
# Default argument
|
||||
elif '=' in param:
|
||||
name, default = map(str.strip, param.split('='))
|
||||
|
|
|
@ -17,7 +17,8 @@ function convertArgs(params, argv) {
|
|||
const conversions = {
|
||||
number: convert.toNumber,
|
||||
boolean: convert.toBoolean,
|
||||
string: (s)=>s,
|
||||
string: s=>s,
|
||||
ModeName: s=>s,
|
||||
}
|
||||
|
||||
const typedArgs = []
|
||||
|
|
Loading…
Add table
Reference in a new issue