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