@rulecad/variables 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/variables.mjs +3 -1
package/package.json
CHANGED
package/variables.mjs
CHANGED
|
@@ -119,7 +119,8 @@ export function resolve(object, { sets = {}, set = {}, display = {}, load } = {}
|
|
|
119
119
|
busy.add(name);
|
|
120
120
|
let src, where;
|
|
121
121
|
if (name.includes('.')) {
|
|
122
|
-
|
|
122
|
+
let [s, r] = name.split('.');
|
|
123
|
+
if (!ruleSets[s] && ruleSets[s.replace(/_/g, '-')]) s = s.replace(/_/g, '-'); // pod_th.width reads the set named pod-th (a - is a minus here)
|
|
123
124
|
if (!ruleSets[s]) throw new Error(`"${name}": rule set "${s}" isn't in uses (${Object.keys(ruleSets).join(', ') || 'none'})`);
|
|
124
125
|
if (!ruleSets[s].rules[r]) throw new Error(`"${name}": no rule "${r}" in ${s}`);
|
|
125
126
|
src = ruleSets[s].rules[r].value; where = (n) => (n.includes('.') ? n : `${s}.${n}`); // a rule's names are its own set's
|
|
@@ -146,6 +147,7 @@ export function resolve(object, { sets = {}, set = {}, display = {}, load } = {}
|
|
|
146
147
|
values[s][r] = lookup(`${s}.${r}`);
|
|
147
148
|
entries.push({ name: `${s}.${r}`, ...d, value: values[s][r], expr: typeof d.value === 'string' ? d.value : undefined, used: used.has(`${s}.${r}`) });
|
|
148
149
|
}
|
|
150
|
+
if (rs.footprints) values[s].footprints = rs.footprints; // pad data for boards (v.esp32c6.footprints.module), as the set gives it
|
|
149
151
|
}
|
|
150
152
|
return { values, entries };
|
|
151
153
|
}
|