1
0

Add array to footprint param types (#76)

This commit is contained in:
Anarion 2023-01-23 21:21:49 +01:00 committed by GitHub
parent 75f907917b
commit b27e10374e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,6 +183,8 @@ const footprint = exports._footprint = (points, net_indexer, component_indexer,
parsed_def = {type: 'number', value: a.mathnum(param_def)(units)} parsed_def = {type: 'number', value: a.mathnum(param_def)(units)}
} else if (def_type == 'boolean') { } else if (def_type == 'boolean') {
parsed_def = {type: 'boolean', value: param_def} parsed_def = {type: 'boolean', value: param_def}
} else if (def_type == 'array') {
parsed_def = {type: 'array', value: param_def}
} else if (def_type == 'undefined') { } else if (def_type == 'undefined') {
parsed_def = {type: 'net', value: undefined} parsed_def = {type: 'net', value: undefined}
} }
@ -197,7 +199,8 @@ const footprint = exports._footprint = (points, net_indexer, component_indexer,
number: v => a.sane(v, `${name}.params.${param_name}`, 'number')(units), number: v => a.sane(v, `${name}.params.${param_name}`, 'number')(units),
boolean: v => v === 'true', boolean: v => v === 'true',
net: v => v, net: v => v,
anchor: v => v anchor: v => v,
array: v => v
} }
if (a.type(value)() == 'string') { if (a.type(value)() == 'string') {
value = u.template(value, point.meta) value = u.template(value, point.meta)
@ -205,7 +208,7 @@ const footprint = exports._footprint = (points, net_indexer, component_indexer,
} }
// type-specific processing // type-specific processing
if (['string', 'number', 'boolean'].includes(type)) { if (['string', 'number', 'boolean', 'array'].includes(type)) {
parsed_params[param_name] = value parsed_params[param_name] = value
} else if (type == 'net') { } else if (type == 'net') {
const net = a.sane(value, `${name}.params.${param_name}`, 'string')(units) const net = a.sane(value, `${name}.params.${param_name}`, 'string')(units)