@ifc-lite/ids 3.1.0 → 3.3.2

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.
Files changed (228) hide show
  1. package/README.md +10 -1
  2. package/dist/audit/coherence/cardinality.js +4 -1
  3. package/dist/audit/coherence/cardinality.js.map +1 -1
  4. package/dist/audit/coherence/index.d.ts +0 -1
  5. package/dist/audit/coherence/index.d.ts.map +1 -1
  6. package/dist/audit/coherence/index.js +59 -45
  7. package/dist/audit/coherence/index.js.map +1 -1
  8. package/dist/audit/coherence/regex.d.ts +3 -3
  9. package/dist/audit/coherence/regex.js +3 -3
  10. package/dist/audit/ifc-schema/attribute-value.d.ts +19 -0
  11. package/dist/audit/ifc-schema/attribute-value.d.ts.map +1 -0
  12. package/dist/audit/ifc-schema/attribute-value.js +71 -0
  13. package/dist/audit/ifc-schema/attribute-value.js.map +1 -0
  14. package/dist/audit/ifc-schema/datatype-check.d.ts +9 -1
  15. package/dist/audit/ifc-schema/datatype-check.d.ts.map +1 -1
  16. package/dist/audit/ifc-schema/datatype-check.js +24 -2
  17. package/dist/audit/ifc-schema/datatype-check.js.map +1 -1
  18. package/dist/audit/ifc-schema/entity-requirement.d.ts +21 -0
  19. package/dist/audit/ifc-schema/entity-requirement.d.ts.map +1 -0
  20. package/dist/audit/ifc-schema/entity-requirement.js +45 -0
  21. package/dist/audit/ifc-schema/entity-requirement.js.map +1 -0
  22. package/dist/audit/ifc-schema/index.d.ts.map +1 -1
  23. package/dist/audit/ifc-schema/index.js +105 -19
  24. package/dist/audit/ifc-schema/index.js.map +1 -1
  25. package/dist/audit/index.d.ts.map +1 -1
  26. package/dist/audit/index.js +8 -2
  27. package/dist/audit/index.js.map +1 -1
  28. package/dist/audit/parser-shim.d.ts +15 -1
  29. package/dist/audit/parser-shim.d.ts.map +1 -1
  30. package/dist/audit/parser-shim.js +2 -2
  31. package/dist/audit/parser-shim.js.map +1 -1
  32. package/dist/audit/structural/index.d.ts +3 -1
  33. package/dist/audit/structural/index.d.ts.map +1 -1
  34. package/dist/audit/structural/index.js +48 -179
  35. package/dist/audit/structural/index.js.map +1 -1
  36. package/dist/audit/structural/shapes.d.ts +47 -0
  37. package/dist/audit/structural/shapes.d.ts.map +1 -0
  38. package/dist/audit/structural/shapes.js +185 -0
  39. package/dist/audit/structural/shapes.js.map +1 -0
  40. package/dist/audit/types.d.ts +9 -1
  41. package/dist/audit/types.d.ts.map +1 -1
  42. package/dist/audit/xsd/index.js +1 -1
  43. package/dist/audit/xsd/index.js.map +1 -1
  44. package/dist/bounded-cache.d.ts +18 -0
  45. package/dist/bounded-cache.d.ts.map +1 -0
  46. package/dist/bounded-cache.js +40 -0
  47. package/dist/bounded-cache.js.map +1 -0
  48. package/dist/bridge/data-accessor.d.ts.map +1 -1
  49. package/dist/bridge/data-accessor.js +49 -25
  50. package/dist/bridge/data-accessor.js.map +1 -1
  51. package/dist/bridge/index.d.ts +1 -0
  52. package/dist/bridge/index.d.ts.map +1 -1
  53. package/dist/bridge/index.js +1 -0
  54. package/dist/bridge/index.js.map +1 -1
  55. package/dist/bridge/measure-conversion.d.ts +51 -0
  56. package/dist/bridge/measure-conversion.d.ts.map +1 -0
  57. package/dist/bridge/measure-conversion.js +106 -0
  58. package/dist/bridge/measure-conversion.js.map +1 -0
  59. package/dist/bridge/predefined-property-sets.d.ts +24 -0
  60. package/dist/bridge/predefined-property-sets.d.ts.map +1 -0
  61. package/dist/bridge/predefined-property-sets.js +86 -0
  62. package/dist/bridge/predefined-property-sets.js.map +1 -0
  63. package/dist/bridge/predefined-types.d.ts +34 -13
  64. package/dist/bridge/predefined-types.d.ts.map +1 -1
  65. package/dist/bridge/predefined-types.js +40 -71
  66. package/dist/bridge/predefined-types.js.map +1 -1
  67. package/dist/bridge/project-property.d.ts +43 -0
  68. package/dist/bridge/project-property.d.ts.map +1 -0
  69. package/dist/bridge/project-property.js +60 -0
  70. package/dist/bridge/project-property.js.map +1 -0
  71. package/dist/bridge/properties.d.ts +4 -3
  72. package/dist/bridge/properties.d.ts.map +1 -1
  73. package/dist/bridge/properties.js +64 -111
  74. package/dist/bridge/properties.js.map +1 -1
  75. package/dist/bridge/property-overlay-resolver.d.ts +10 -0
  76. package/dist/bridge/property-overlay-resolver.d.ts.map +1 -1
  77. package/dist/bridge/property-overlay-resolver.js +53 -4
  78. package/dist/bridge/property-overlay-resolver.js.map +1 -1
  79. package/dist/bridge/units.d.ts +49 -20
  80. package/dist/bridge/units.d.ts.map +1 -1
  81. package/dist/bridge/units.js +134 -84
  82. package/dist/bridge/units.js.map +1 -1
  83. package/dist/constraint-types.d.ts +30 -14
  84. package/dist/constraint-types.d.ts.map +1 -1
  85. package/dist/constraints/comparators.d.ts +4 -1
  86. package/dist/constraints/comparators.d.ts.map +1 -1
  87. package/dist/constraints/comparators.js +6 -1
  88. package/dist/constraints/comparators.js.map +1 -1
  89. package/dist/constraints/describe.d.ts.map +1 -1
  90. package/dist/constraints/describe.js +67 -21
  91. package/dist/constraints/describe.js.map +1 -1
  92. package/dist/constraints/match-bounds.d.ts +25 -0
  93. package/dist/constraints/match-bounds.d.ts.map +1 -0
  94. package/dist/constraints/match-bounds.js +112 -0
  95. package/dist/constraints/match-bounds.js.map +1 -0
  96. package/dist/constraints/match-family.d.ts.map +1 -1
  97. package/dist/constraints/match-family.js +25 -90
  98. package/dist/constraints/match-family.js.map +1 -1
  99. package/dist/constraints/xsd-datetime.js +6 -6
  100. package/dist/constraints/xsd-examples.d.ts +20 -0
  101. package/dist/constraints/xsd-examples.d.ts.map +1 -0
  102. package/dist/constraints/xsd-examples.js +187 -0
  103. package/dist/constraints/xsd-examples.js.map +1 -0
  104. package/dist/constraints/xsd-lexical.d.ts +2 -0
  105. package/dist/constraints/xsd-lexical.d.ts.map +1 -0
  106. package/dist/constraints/xsd-lexical.js +49 -0
  107. package/dist/constraints/xsd-lexical.js.map +1 -0
  108. package/dist/constraints/xsd-order.d.ts +33 -0
  109. package/dist/constraints/xsd-order.d.ts.map +1 -0
  110. package/dist/constraints/xsd-order.js +211 -0
  111. package/dist/constraints/xsd-order.js.map +1 -0
  112. package/dist/constraints/xsd-regex-ast.d.ts +37 -0
  113. package/dist/constraints/xsd-regex-ast.d.ts.map +1 -0
  114. package/dist/constraints/xsd-regex-ast.js +137 -0
  115. package/dist/constraints/xsd-regex-ast.js.map +1 -0
  116. package/dist/constraints/xsd-regex-blocks.d.ts +7 -0
  117. package/dist/constraints/xsd-regex-blocks.d.ts.map +1 -0
  118. package/dist/constraints/xsd-regex-blocks.js +68 -0
  119. package/dist/constraints/xsd-regex-blocks.js.map +1 -0
  120. package/dist/constraints/xsd-regex.d.ts +2 -45
  121. package/dist/constraints/xsd-regex.d.ts.map +1 -1
  122. package/dist/constraints/xsd-regex.js +231 -134
  123. package/dist/constraints/xsd-regex.js.map +1 -1
  124. package/dist/facets/entity-facet.d.ts.map +1 -1
  125. package/dist/facets/entity-facet.js +4 -1
  126. package/dist/facets/entity-facet.js.map +1 -1
  127. package/dist/facets/partof-facet.d.ts.map +1 -1
  128. package/dist/facets/partof-facet.js +80 -19
  129. package/dist/facets/partof-facet.js.map +1 -1
  130. package/dist/facets/predefined-type-match.d.ts +8 -3
  131. package/dist/facets/predefined-type-match.d.ts.map +1 -1
  132. package/dist/facets/predefined-type-match.js.map +1 -1
  133. package/dist/index.d.ts +9 -2
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +24 -0
  136. package/dist/index.js.map +1 -1
  137. package/dist/parser/dom.d.ts +4 -0
  138. package/dist/parser/dom.d.ts.map +1 -1
  139. package/dist/parser/dom.js +5 -0
  140. package/dist/parser/dom.js.map +1 -1
  141. package/dist/parser/parse-restriction.d.ts.map +1 -1
  142. package/dist/parser/parse-restriction.js +32 -14
  143. package/dist/parser/parse-restriction.js.map +1 -1
  144. package/dist/parser/xml-parser.d.ts +7 -4
  145. package/dist/parser/xml-parser.d.ts.map +1 -1
  146. package/dist/parser/xml-parser.js +30 -45
  147. package/dist/parser/xml-parser.js.map +1 -1
  148. package/dist/preview/audit.d.ts +16 -0
  149. package/dist/preview/audit.d.ts.map +1 -0
  150. package/dist/preview/audit.js +58 -0
  151. package/dist/preview/audit.js.map +1 -0
  152. package/dist/preview/features.d.ts +30 -0
  153. package/dist/preview/features.d.ts.map +1 -0
  154. package/dist/preview/features.js +96 -0
  155. package/dist/preview/features.js.map +1 -0
  156. package/dist/preview/parse-ids11.d.ts +9 -0
  157. package/dist/preview/parse-ids11.d.ts.map +1 -0
  158. package/dist/preview/parse-ids11.js +90 -0
  159. package/dist/preview/parse-ids11.js.map +1 -0
  160. package/dist/preview/partof-nested.d.ts +27 -0
  161. package/dist/preview/partof-nested.d.ts.map +1 -0
  162. package/dist/preview/partof-nested.js +61 -0
  163. package/dist/preview/partof-nested.js.map +1 -0
  164. package/dist/preview/tolerance.d.ts +15 -0
  165. package/dist/preview/tolerance.d.ts.map +1 -0
  166. package/dist/preview/tolerance.js +66 -0
  167. package/dist/preview/tolerance.js.map +1 -0
  168. package/dist/preview/types.d.ts +67 -0
  169. package/dist/preview/types.d.ts.map +1 -0
  170. package/dist/preview/types.js +5 -0
  171. package/dist/preview/types.js.map +1 -0
  172. package/dist/report-types.d.ts +7 -0
  173. package/dist/report-types.d.ts.map +1 -1
  174. package/dist/translation/describe-constraint.js +16 -14
  175. package/dist/translation/describe-constraint.js.map +1 -1
  176. package/dist/translation/locales/de.d.ts +2 -0
  177. package/dist/translation/locales/de.d.ts.map +1 -1
  178. package/dist/translation/locales/de.js +2 -0
  179. package/dist/translation/locales/de.js.map +1 -1
  180. package/dist/translation/locales/en.d.ts +2 -0
  181. package/dist/translation/locales/en.d.ts.map +1 -1
  182. package/dist/translation/locales/en.js +2 -0
  183. package/dist/translation/locales/en.js.map +1 -1
  184. package/dist/translation/locales/fr.d.ts +2 -0
  185. package/dist/translation/locales/fr.d.ts.map +1 -1
  186. package/dist/translation/locales/fr.js +2 -0
  187. package/dist/translation/locales/fr.js.map +1 -1
  188. package/dist/translation/locales/index.d.ts +1 -0
  189. package/dist/translation/locales/index.d.ts.map +1 -1
  190. package/dist/translation/locales/index.js +1 -0
  191. package/dist/translation/locales/index.js.map +1 -1
  192. package/dist/translation/locales/it.d.ts +198 -0
  193. package/dist/translation/locales/it.d.ts.map +1 -0
  194. package/dist/translation/locales/it.js +235 -0
  195. package/dist/translation/locales/it.js.map +1 -0
  196. package/dist/translation/service.d.ts +2 -6
  197. package/dist/translation/service.d.ts.map +1 -1
  198. package/dist/translation/service.js +17 -25
  199. package/dist/translation/service.js.map +1 -1
  200. package/dist/types.d.ts +26 -31
  201. package/dist/types.d.ts.map +1 -1
  202. package/dist/validation/format-failure-reason.js +1 -1
  203. package/dist/validation/format-failure-reason.js.map +1 -1
  204. package/dist/validation/pass-rate.d.ts +14 -0
  205. package/dist/validation/pass-rate.d.ts.map +1 -0
  206. package/dist/validation/pass-rate.js +25 -0
  207. package/dist/validation/pass-rate.js.map +1 -0
  208. package/dist/validation/prohibited-specification.d.ts +31 -0
  209. package/dist/validation/prohibited-specification.d.ts.map +1 -0
  210. package/dist/validation/prohibited-specification.js +25 -0
  211. package/dist/validation/prohibited-specification.js.map +1 -0
  212. package/dist/validation/validator.d.ts +4 -2
  213. package/dist/validation/validator.d.ts.map +1 -1
  214. package/dist/validation/validator.js +23 -18
  215. package/dist/validation/validator.js.map +1 -1
  216. package/dist/writer/constraint.d.ts +8 -0
  217. package/dist/writer/constraint.d.ts.map +1 -0
  218. package/dist/writer/constraint.js +142 -0
  219. package/dist/writer/constraint.js.map +1 -0
  220. package/dist/writer/index.d.ts +48 -0
  221. package/dist/writer/index.d.ts.map +1 -0
  222. package/dist/writer/index.js +209 -0
  223. package/dist/writer/index.js.map +1 -0
  224. package/dist/writer/xml-lines.d.ts +17 -0
  225. package/dist/writer/xml-lines.d.ts.map +1 -0
  226. package/dist/writer/xml-lines.js +69 -0
  227. package/dist/writer/xml-lines.js.map +1 -0
  228. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"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IAAI,CAAC,IAAI;YACf,UAAU,EAAE,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAY,EAAE,MAAM,CAAC,CAAC;SACtF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -67,4 +67,14 @@ export type PropertyOverlayResolver = (expressId: number) => PropertyOverride[]
67
67
  * consumes it in agreement.
68
68
  */
69
69
  export declare function resolveEffectivePropertySets(store: IfcDataStore, expressId: number, propertyOverlay: PropertyOverlayResolver | undefined): PropertySetInfo[];
70
+ /**
71
+ * The inverse of what {@link resolveEffectivePropertySets} applies to an
72
+ * override: convert a base-SI value (an IDS literal, or a correction typed to
73
+ * satisfy one) into the raw frame `psetName`.`propName` on `expressId` is
74
+ * stored in — the property's own `Unit` when it declares one, else the
75
+ * project unit for `dataType` (or, when omitted, the property's own
76
+ * dataType). A property the entity does not carry yet takes the project
77
+ * unit, matching how a created override is read back.
78
+ */
79
+ export declare function propertyValueToRaw(store: IfcDataStore, expressId: number, psetName: string, propName: string, dataType: string | undefined, value: string | number | boolean): string | number | boolean;
70
80
  //# sourceMappingURL=property-overlay-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"property-overlay-resolver.d.ts","sourceRoot":"","sources":["../../src/bridge/property-overlay-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAKnD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACxC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,gBAAgB,EAAE,GAAG,SAAS,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,uBAAuB,GAAG,SAAS,GACnD,eAAe,EAAE,CA0HnB"}
1
+ {"version":3,"file":"property-overlay-resolver.d.ts","sourceRoot":"","sources":["../../src/bridge/property-overlay-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAanD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACxC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,gBAAgB,EAAE,GAAG,SAAS,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,uBAAuB,GAAG,SAAS,GACnD,eAAe,EAAE,CAkInB;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAC/B,MAAM,GAAG,MAAM,GAAG,OAAO,CAgB3B"}
@@ -1,8 +1,10 @@
1
1
  /* This Source Code Form is subject to the terms of the Mozilla Public
2
2
  * License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { fromSi, isIdentity, toSi } from './measure-conversion.js';
4
5
  import { collectAllPropertySets } from './properties.js';
5
- import { resolveEntityMeasureScales, toBaseSI } from './units.js';
6
+ import { copyOwnUnit, ownUnitOf } from './project-property.js';
7
+ import { ownUnitConversionFor, resolveEntityMeasureScales, toBaseSI, toRaw, } from './units.js';
6
8
  /**
7
9
  * Property sets for `expressId`, with any pending overlay writes applied
8
10
  * on top of the canonical (parsed) result. The canonical projection stays
@@ -45,7 +47,11 @@ export function resolveEffectivePropertySets(store, expressId, propertyOverlay)
45
47
  // base projection's cached/shared objects are never touched.
46
48
  const result = base.map((pset) => ({
47
49
  ...pset,
48
- properties: pset.properties.map((p) => ({ ...p })),
50
+ properties: pset.properties.map((p) => {
51
+ const copy = { ...p };
52
+ copyOwnUnit(p, copy);
53
+ return copy;
54
+ }),
49
55
  }));
50
56
  // The overlay's raw values (a `PropertyOverride.value` mirrors whatever
51
57
  // was written through `MutablePropertyView.setProperty`, e.g. an IDS
@@ -101,10 +107,14 @@ export function resolveEffectivePropertySets(store, expressId, propertyOverlay)
101
107
  // scale: a non-measure property (IFCLABEL, boolean, identifier)
102
108
  // has no scale and passes through untouched.
103
109
  const existing = targetSet.properties[idx];
104
- targetSet.properties[idx] = {
110
+ const replacement = {
105
111
  ...existing,
106
- value: toBaseSI(override.value, existing.dataType, scales),
112
+ value: existingToBaseSI(existing, override.value, scales),
107
113
  };
114
+ // Keep its own Unit so a later override of the same property in this
115
+ // array converts in that unit too.
116
+ copyOwnUnit(existing, replacement);
117
+ targetSet.properties[idx] = replacement;
108
118
  }
109
119
  else if (matchingSets.length > 0) {
110
120
  // No same-named set carries this property yet — a PROPERTY_MISSING
@@ -153,4 +163,43 @@ export function resolveEffectivePropertySets(store, expressId, propertyOverlay)
153
163
  }
154
164
  return result;
155
165
  }
166
+ /**
167
+ * An override of an EXISTING property is written in that property's raw
168
+ * frame: its own `Unit` when it declares one (#7395), else the project's.
169
+ */
170
+ function existingToBaseSI(existing, value, scales) {
171
+ const own = ownUnitOf(existing);
172
+ if (!own)
173
+ return toBaseSI(value, existing.dataType, scales);
174
+ const c = ownUnitConversionFor(existing.dataType, own.siScale, own.symbol, own.siOffset);
175
+ return typeof value === 'number' && !isIdentity(c) ? toSi(value, c) : value;
176
+ }
177
+ /**
178
+ * The inverse of what {@link resolveEffectivePropertySets} applies to an
179
+ * override: convert a base-SI value (an IDS literal, or a correction typed to
180
+ * satisfy one) into the raw frame `psetName`.`propName` on `expressId` is
181
+ * stored in — the property's own `Unit` when it declares one, else the
182
+ * project unit for `dataType` (or, when omitted, the property's own
183
+ * dataType). A property the entity does not carry yet takes the project
184
+ * unit, matching how a created override is read back.
185
+ */
186
+ export function propertyValueToRaw(store, expressId, psetName, propName, dataType, value) {
187
+ const psetLower = psetName.toLowerCase();
188
+ const propLower = propName.toLowerCase();
189
+ let existing;
190
+ for (const pset of collectAllPropertySets(store, expressId)) {
191
+ if (pset.name.toLowerCase() !== psetLower)
192
+ continue;
193
+ existing = pset.properties.find((p) => p.name.toLowerCase() === propLower);
194
+ if (existing)
195
+ break;
196
+ }
197
+ const effectiveType = dataType ?? existing?.dataType;
198
+ const own = existing && ownUnitOf(existing);
199
+ if (own) {
200
+ const c = ownUnitConversionFor(effectiveType, own.siScale, own.symbol, own.siOffset);
201
+ return typeof value === 'number' && !isIdentity(c) ? fromSi(value, c) : value;
202
+ }
203
+ return toRaw(value, effectiveType, resolveEntityMeasureScales(store, expressId));
204
+ }
156
205
  //# sourceMappingURL=property-overlay-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"property-overlay-resolver.js","sourceRoot":"","sources":["../../src/bridge/property-overlay-resolver.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAM/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAqClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,4BAA4B,CAC1C,KAAmB,EACnB,SAAiB,EACjB,eAAoD;IAEpD,MAAM,IAAI,GAAG,sBAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC,SAAS,CAAC,CAAC;IAC/C,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEtD,yEAAyE;IACzE,6DAA6D;IAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACjC,GAAG,IAAI;QACP,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;KACnD,CAAC,CAAC,CAAC;IAEJ,wEAAwE;IACxE,qEAAqE;IACrE,uEAAuE;IACvE,wEAAwE;IACxE,4DAA4D;IAC5D,yEAAyE;IACzE,qEAAqE;IACrE,qEAAqE;IACrE,8EAA8E;IAC9E,6EAA6E;IAC7E,mEAAmE;IACnE,sBAAsB;IACtB,MAAM,MAAM,GAAG,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAE5D,KAAK,MAAM,QAAQ,IAAI,S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EAAE,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,CAA8B,CAAC;AAChH,CAAC"}
@@ -1,18 +1,21 @@
1
- import { type IfcDataStore } from '@ifc-lite/parser';
1
+ import { type IfcDataStore, type ProjectUnits } from '@ifc-lite/parser';
2
+ import { type SiConversion } from './measure-conversion.js';
2
3
  /**
3
4
  * Per IDS spec, IDS literal values for IFC measure types are always in
4
5
  * base SI units. The IFC store keeps the raw author value, so when the
5
6
  * project's length unit is `MILLI`, a stored `1000` length means
6
7
  * `1.0 metre` and the IDS check `1` should match. This helper applies
7
8
  * the project's `lengthUnitScale` to numeric values for length
8
- * measures, and the analogous area/volume scale to area/volume measures.
9
+ * measures, the analogous area/volume scale to area/volume measures, and
10
+ * the declared project unit to every other dimensioned measure (angle,
11
+ * temperature, mass, time, force, power, ...; see measure-conversion.ts).
9
12
  *
10
- * Properties without a declared dataType (notably `IfcPropertyTableValue`,
11
- * where columns mix labels and measures) get a conservative double-up:
12
- * every numeric candidate is surfaced both raw and scaled, so an IDS
13
- * check using either unit space matches. That double-up only ever uses
14
- * the length scale — an untyped table has no dataType to key an
15
- * area/volume exponent off, so it is out of scope here as before.
13
+ * Properties without one shared dataType (an `IfcPropertyTableValue`, where
14
+ * columns mix labels and measures, or a list mixing types) convert each
15
+ * member by its own type when the parser reports it (`valueDataTypes`).
16
+ * Only a source that does not (the prebuilt property table of a
17
+ * server-parsed store) keeps the old conservative double-up: every numeric
18
+ * candidate is surfaced both raw and length-scaled.
16
19
  */
17
20
  /**
18
21
  * Declared AREAUNIT / VOLUMEUNIT scale for a project, when explicitly
@@ -27,6 +30,10 @@ import { type IfcDataStore } from '@ifc-lite/parser';
27
30
  export interface MeasureScales {
28
31
  area?: number;
29
32
  volume?: number;
33
+ /** The project's declared units, for measures outside the length family. */
34
+ units?: ProjectUnits;
35
+ /** File-wide units, for a measure `units` leaves undeclared (a project without its own LENGTHUNIT). */
36
+ fallbackUnits?: ProjectUnits;
30
37
  }
31
38
  /**
32
39
  * Resolve the file-declared area/volume scale for `store`, reusing the
@@ -70,24 +77,21 @@ export interface EntityMeasureScales extends MeasureScales {
70
77
  */
71
78
  export declare function resolveEntityMeasureScales(store: IfcDataStore, expressId: number): EntityMeasureScales;
72
79
  /**
73
- * The raw-to-base-SI multiplier for a scalar measure of `dataType`, given
74
- * the entity's resolved {@link EntityMeasureScales}. Area scales by the
75
- * SQUARE of the length factor and volume by the CUBE (a millimetre-authored
76
- * 1 m² is stored as 1e6 mm², not 1e3) — NOT the raw length scale — unless
77
- * the file declares an explicit AREAUNIT/VOLUMEUNIT, which takes
78
- * precedence (IFC does not require it to relate to LENGTHUNIT by that
79
- * exponent; see `resolveMeasureScales` above). `undefined` for a
80
- * non-measure `dataType` or when the entity has no resolved length scale.
80
+ * The raw-to-SI conversion for a value of `dataType` held in the project's
81
+ * units: the length family through {@link lengthFamilyScale}, every other
82
+ * dimensioned measure through its declared project unit. The single
83
+ * classification the base projection, an overlay correction and a
84
+ * correction write all key off, so "which measures convert, and how" can't
85
+ * drift between them.
81
86
  */
82
- export declare function measureScaleFor(dataType: string | undefined, scales: EntityMeasureScales): number | undefined;
87
+ export declare function measureConversionFor(dataType: string | undefined, scales: EntityMeasureScales): SiConversion | undefined;
83
88
  /**
84
89
  * Convert a raw-frame scalar value — the frame every stored IFC property,
85
90
  * and every `MutablePropertyView` property mutation, is written in — into
86
91
  * the base-SI frame `applyUnitConversion`/`projectProperty` already put
87
92
  * every OTHER property of the same pset into. Only numeric measure values
88
93
  * move; strings, booleans and non-measure dataTypes pass through
89
- * unchanged, and a value that is already `1` scale (e.g. a metre project)
90
- * is returned as-is rather than re-boxed.
94
+ * unchanged, and a value already in SI is returned as-is.
91
95
  */
92
96
  export declare function toBaseSI(rawValue: string | number | boolean | null, dataType: string | undefined, scales: EntityMeasureScales): string | number | boolean | null;
93
97
  /**
@@ -96,7 +100,32 @@ export declare function toBaseSI(rawValue: string | number | boolean | null, dat
96
100
  * frame the model actually stores. Only numeric measure values move.
97
101
  */
98
102
  export declare function toRaw(baseSIValue: string | number | boolean | null, dataType: string | undefined, scales: EntityMeasureScales): string | number | boolean | null;
99
- export declare function applyUnitConversion(rawValue: string | number | boolean | null, rawValues: string[] | undefined, dataType: string | undefined, scale: number | undefined, measureScales?: MeasureScales): {
103
+ /**
104
+ * The conversion for a value whose property or quantity declares its OWN
105
+ * `Unit`. `siScale` is the parser's resolved SI factor of that unit
106
+ * (`unitSiScale` / `explicitUnitSiScale`), `symbol` its display symbol, `siOffset` its °F offset;
107
+ * an unresolved factor, a non-measure dataType or a monetary value (not an
108
+ * SI quantity) gives `undefined`: the value stays as written.
109
+ */
110
+ export declare function ownUnitConversionFor(dataType: string | undefined, siScale: number | undefined, symbol: string | undefined, siOffset?: number): SiConversion | undefined;
111
+ /**
112
+ * Convert a value whose property or quantity declares its OWN `Unit` into
113
+ * SI. IFC uses that `Unit` precisely to let one value depart from the
114
+ * project's unit assignment, so the project factor must not be applied to
115
+ * it (#7395). A unit that is present but could not be read leaves the value
116
+ * raw rather than silently rescaled by the project factor.
117
+ */
118
+ export declare function applyOwnUnitConversion(rawValue: string | number | boolean | null, rawValues: string[] | undefined, dataType: string | undefined, siScale: number | undefined, symbol?: string, valueDataTypes?: ReadonlyArray<string | undefined>, siOffset?: number): {
119
+ value: string | number | boolean | null;
120
+ values: string[] | undefined;
121
+ };
122
+ /**
123
+ * Convert a value held in the project's units into SI. A multi-valued
124
+ * property without a shared `dataType` converts each member by its own
125
+ * type (`valueDataTypes`, index-aligned with `rawValues`); without those
126
+ * types, see the module doc's legacy double-up.
127
+ */
128
+ export declare function applyUnitConversion(rawValue: string | number | boolean | null, rawValues: string[] | undefined, dataType: string | undefined, scale: number | undefined, measureScales?: MeasureScales, valueDataTypes?: ReadonlyArray<string | undefined>): {
100
129
  value: string | number | boolean | null;
101
130
  values: string[] | undefined;
102
131
  };
@@ -1 +1 @@
1
- {"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src/bridge/units.ts"],"names":[],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M,GAAG,SAAS,EAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,aAAa,CAAC,EAAE,aAAa,EAC7B,cAAc,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GACjD;IAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CAAE,CA0B3E"}
@@ -2,7 +2,22 @@
2
2
  * License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
4
  import { extractLengthUnitScale, extractProjectUnits, resolveOwningIfcProjectId, } from '@ifc-lite/parser';
5
+ import { convertNumeric, convertTypedMembers, fromSi, isIdentity, lengthFamilyKind, projectUnitConversion, toSi, unitConversion, } from './measure-conversion.js';
5
6
  const projectUnitsCache = new WeakMap();
7
+ /**
8
+ * The declared AREAUNIT/VOLUMEUNIT scale of `units`. One that is declared but
9
+ * cannot be resolved (`unitForMeasure` null) gives 1: the value stays
10
+ * unconverted, as `projectUnitConversion` does for other measures, rather
11
+ * than being derived from the length scale or taken from another project.
12
+ * `otherwise` answers a unit that is not declared at all.
13
+ */
14
+ function declaredScale(units, unitType, otherwise) {
15
+ const resolved = units.resolvedForUnitType(unitType)?.siScale;
16
+ if (resolved !== undefined)
17
+ return resolved;
18
+ const measure = unitType === 'AREAUNIT' ? 'IFCAREAMEASURE' : 'IFCVOLUMEMEASURE';
19
+ return units.unitForMeasure(measure) === null ? 1 : otherwise;
20
+ }
6
21
  /**
7
22
  * Resolve the file-declared area/volume scale for `store`, reusing the
8
23
  * canonical `ProjectUnits` resolver (`@ifc-lite/parser`, mirror of
@@ -23,8 +38,9 @@ export function resolveMeasureScales(store) {
23
38
  projectUnitsCache.set(store, units);
24
39
  }
25
40
  return {
26
- area: units.resolvedForUnitType('AREAUNIT')?.siScale,
27
- volume: units.resolvedForUnitType('VOLUMEUNIT')?.siScale,
41
+ area: declaredScale(units, 'AREAUNIT', undefined),
42
+ volume: declaredScale(units, 'VOLUMEUNIT', undefined),
43
+ units,
28
44
  };
29
45
  }
30
46
  const entityProjectScaleCache = new WeakMap();
@@ -92,7 +108,19 @@ export function resolveEntityMeasureScales(store, expressId) {
92
108
  // area/volume scale, which IFC does not require to be related by that
93
109
  // exponent (see the module doc above). Take the file-wide answer for
94
110
  // all three together, matching the walk-failed fallback exactly.
95
- scales = fallback();
111
+ // A measure outside the length family still takes the owner's own
112
+ // declared unit (a project may declare grams without a LENGTHUNIT);
113
+ // only one the owner leaves undeclared takes the file-wide unit.
114
+ // An owner's own AREAUNIT/VOLUMEUNIT still wins over the file-wide one,
115
+ // and one it declares but cannot resolve leaves the value unconverted.
116
+ const fileWide = fallback();
117
+ scales = {
118
+ ...fileWide,
119
+ area: declaredScale(units, 'AREAUNIT', fileWide.area),
120
+ volume: declaredScale(units, 'VOLUMEUNIT', fileWide.volume),
121
+ units,
122
+ fallbackUnits: fileWide.units,
123
+ };
96
124
  byProject.set(ownerId, scales);
97
125
  return scales;
98
126
  }
@@ -105,43 +133,27 @@ export function resolveEntityMeasureScales(store, expressId) {
105
133
  // length-unit-resolvers-agreement.test.ts).
106
134
  scales = {
107
135
  length: extractLengthUnitScale(store.source, store.entityIndex, ownerId),
108
- area: units.resolvedForUnitType('AREAUNIT')?.siScale,
109
- volume: units.resolvedForUnitType('VOLUMEUNIT')?.siScale,
136
+ area: declaredScale(units, 'AREAUNIT', undefined),
137
+ volume: declaredScale(units, 'VOLUMEUNIT', undefined),
138
+ units,
110
139
  };
111
140
  byProject.set(ownerId, scales);
112
141
  }
113
142
  return scales;
114
143
  }
115
144
  /**
116
- * Which scalable IFC measure dimension `dataType` names, or `undefined`
117
- * for anything this module doesn't scale (labels, identifiers, booleans,
118
- * an untyped table column). The single classification both
119
- * `applyUnitConversion` and the raw/base-SI helpers below key off, so
120
- * "which measure types get scaled" can't drift between the base
121
- * projection and an overlay correction.
122
- */
123
- function measureKind(dataType) {
124
- const upper = dataType ? dataType.toUpperCase() : '';
125
- if (upper === 'IFCLENGTHMEASURE' || upper === 'IFCPOSITIVELENGTHMEASURE')
126
- return 'length';
127
- if (upper === 'IFCAREAMEASURE')
128
- return 'area';
129
- if (upper === 'IFCVOLUMEMEASURE')
130
- return 'volume';
131
- return undefined;
132
- }
133
- /**
134
- * The raw-to-base-SI multiplier for a scalar measure of `dataType`, given
135
- * the entity's resolved {@link EntityMeasureScales}. Area scales by the
145
+ * The raw-to-base-SI multiplier for a length-family measure of `dataType`,
146
+ * given the entity's resolved {@link EntityMeasureScales}. Area scales by the
136
147
  * SQUARE of the length factor and volume by the CUBE (a millimetre-authored
137
148
  * 1 m² is stored as 1e6 mm², not 1e3) — NOT the raw length scale — unless
138
149
  * the file declares an explicit AREAUNIT/VOLUMEUNIT, which takes
139
150
  * precedence (IFC does not require it to relate to LENGTHUNIT by that
140
151
  * exponent; see `resolveMeasureScales` above). `undefined` for a
141
- * non-measure `dataType` or when the entity has no resolved length scale.
152
+ * measure outside the length family or when the entity has no resolved
153
+ * length scale.
142
154
  */
143
- export function measureScaleFor(dataType, scales) {
144
- const kind = measureKind(dataType);
155
+ function lengthFamilyScale(dataType, scales) {
156
+ const kind = lengthFamilyKind(dataType);
145
157
  if (!kind)
146
158
  return undefined;
147
159
  if (kind === 'length')
@@ -151,22 +163,33 @@ export function measureScaleFor(dataType, scales) {
151
163
  }
152
164
  return scales.volume ?? (scales.length != null ? scales.length ** 3 : undefined);
153
165
  }
166
+ /**
167
+ * The raw-to-SI conversion for a value of `dataType` held in the project's
168
+ * units: the length family through {@link lengthFamilyScale}, every other
169
+ * dimensioned measure through its declared project unit. The single
170
+ * classification the base projection, an overlay correction and a
171
+ * correction write all key off, so "which measures convert, and how" can't
172
+ * drift between them.
173
+ */
174
+ export function measureConversionFor(dataType, scales) {
175
+ const scale = lengthFamilyScale(dataType, scales);
176
+ if (scale !== undefined)
177
+ return scale ? { scale, offset: 0 } : undefined;
178
+ return projectUnitConversion(dataType, scales.units, scales.fallbackUnits);
179
+ }
154
180
  /**
155
181
  * Convert a raw-frame scalar value — the frame every stored IFC property,
156
182
  * and every `MutablePropertyView` property mutation, is written in — into
157
183
  * the base-SI frame `applyUnitConversion`/`projectProperty` already put
158
184
  * every OTHER property of the same pset into. Only numeric measure values
159
185
  * move; strings, booleans and non-measure dataTypes pass through
160
- * unchanged, and a value that is already `1` scale (e.g. a metre project)
161
- * is returned as-is rather than re-boxed.
186
+ * unchanged, and a value already in SI is returned as-is.
162
187
  */
163
188
  export function toBaseSI(rawValue, dataType, scales) {
164
189
  if (typeof rawValue !== 'number')
165
190
  return rawValue;
166
- const scale = measureScaleFor(dataType, scales);
167
- if (!scale || scale === 1)
168
- return rawValue;
169
- return rawValue * scale;
191
+ const c = measureConversionFor(dataType, scales);
192
+ return isIdentity(c) ? rawValue : toSi(rawValue, c);
170
193
  }
171
194
  /**
172
195
  * The inverse of {@link toBaseSI}: convert a base-SI scalar — an IDS
@@ -176,61 +199,88 @@ export function toBaseSI(rawValue, dataType, scales) {
176
199
  export function toRaw(baseSIValue, dataType, scales) {
177
200
  if (typeof baseSIValue !== 'number')
178
201
  return baseSIValue;
179
- const scale = measureScaleFor(dataType, scales);
180
- if (!scale || scale === 1)
181
- return baseSIValue;
182
- return baseSIValue / scale;
202
+ const c = measureConversionFor(dataType, scales);
203
+ return isIdentity(c) ? baseSIValue : fromSi(baseSIValue, c);
204
+ }
205
+ /**
206
+ * The conversion for a value whose property or quantity declares its OWN
207
+ * `Unit`. `siScale` is the parser's resolved SI factor of that unit
208
+ * (`unitSiScale` / `explicitUnitSiScale`), `symbol` its display symbol, `siOffset` its °F offset;
209
+ * an unresolved factor, a non-measure dataType or a monetary value (not an
210
+ * SI quantity) gives `undefined`: the value stays as written.
211
+ */
212
+ export function ownUnitConversionFor(dataType, siScale, symbol, siOffset) {
213
+ const upper = dataType ? dataType.toUpperCase() : '';
214
+ if (!upper.endsWith('MEASURE') || upper === 'IFCMONETARYMEASURE')
215
+ return undefined;
216
+ return unitConversion(upper, siScale, symbol, siOffset);
217
+ }
218
+ /**
219
+ * A list's display value is its members joined by the parser; rebuild it from
220
+ * the converted members so it matches them.
221
+ */
222
+ function listDisplayValue(rawValue, values) {
223
+ return typeof rawValue === 'string' ? values.join(', ') : rawValue;
183
224
  }
184
- export function applyUnitConversion(rawValue, rawValues, dataType, scale, measureScales) {
185
- const kind = measureKind(dataType);
186
- const isUntypedTable = !dataType && Array.isArray(rawValues) && rawValues.length > 0;
187
- if (!kind && !isUntypedTable) {
225
+ function convertAll(rawValue, rawValues, c) {
226
+ if (isIdentity(c))
188
227
  return { value: rawValue, values: rawValues };
228
+ const values = Array.isArray(rawValues)
229
+ ? rawValues.map((m) => {
230
+ const cm = convertNumeric(m, c);
231
+ return cm == null ? String(m) : String(cm);
232
+ })
233
+ : rawValues;
234
+ if (values && values.length > 1 && typeof rawValue === 'string') {
235
+ return { value: listDisplayValue(rawValue, values), values };
189
236
  }
190
- if (isUntypedTable) {
191
- if (!scale || scale === 1) {
192
- return { value: rawValue, values: rawValues };
193
- }
194
- const convertNum = (v) => {
195
- const n = typeof v === 'number' ? v : parseFloat(String(v));
196
- return Number.isFinite(n) ? n * scale : null;
197
- };
198
- // Untyped table — keep raw values and append scaled copies for every
199
- // numeric candidate so either unit space matches.
200
- const expanded = [];
201
- for (const v of rawValues) {
202
- expanded.push(String(v));
203
- const c = convertNum(v);
204
- if (c != null && String(c) !== String(v))
205
- expanded.push(String(c));
206
- }
207
- return { value: rawValue, values: expanded };
237
+ const v = typeof rawValue === 'boolean' || rawValue === null ? null : convertNumeric(rawValue, c);
238
+ return { value: v == null ? rawValue : v, values };
239
+ }
240
+ /**
241
+ * Convert a value whose property or quantity declares its OWN `Unit` into
242
+ * SI. IFC uses that `Unit` precisely to let one value depart from the
243
+ * project's unit assignment, so the project factor must not be applied to
244
+ * it (#7395). A unit that is present but could not be read leaves the value
245
+ * raw rather than silently rescaled by the project factor.
246
+ */
247
+ export function applyOwnUnitConversion(rawValue, rawValues, dataType, siScale, symbol, valueDataTypes, siOffset) {
248
+ // A mixed list has no shared dataType; convert each member by its own type.
249
+ if (!dataType && Array.isArray(rawValues) && rawValues.length > 0 && valueDataTypes?.length === rawValues.length) {
250
+ const values = convertTypedMembers(rawValues, valueDataTypes, (t) => ownUnitConversionFor(t, siScale, symbol, siOffset));
251
+ return { value: listDisplayValue(rawValue, values), values };
208
252
  }
209
- // Dimension handling (length vs. area-squared vs. volume-cubed) lives in
210
- // `measureScaleFor` — see its doc for why area/volume don't just reuse
211
- // the raw length scale.
212
- const effectiveScale = measureScaleFor(dataType, {
213
- length: scale,
214
- area: measureScales?.area,
215
- volume: measureScales?.volume,
216
- });
217
- if (!effectiveScale || effectiveScale === 1) {
253
+ return convertAll(rawValue, rawValues, ownUnitConversionFor(dataType, siScale, symbol, siOffset));
254
+ }
255
+ /**
256
+ * Convert a value held in the project's units into SI. A multi-valued
257
+ * property without a shared `dataType` converts each member by its own
258
+ * type (`valueDataTypes`, index-aligned with `rawValues`); without those
259
+ * types, see the module doc's legacy double-up.
260
+ */
261
+ export function applyUnitConversion(rawValue, rawValues, dataType, scale, measureScales, valueDataTypes) {
262
+ const scales = { length: scale, ...measureScales };
263
+ const isUntypedMulti = !dataType && Array.isArray(rawValues) && rawValues.length > 0;
264
+ if (!isUntypedMulti) {
265
+ return convertAll(rawValue, rawValues, measureConversionFor(dataType, scales));
266
+ }
267
+ if (valueDataTypes && valueDataTypes.length === rawValues.length) {
268
+ const values = convertTypedMembers(rawValues, valueDataTypes, (t) => measureConversionFor(t, scales));
269
+ return { value: listDisplayValue(rawValue, values), values };
270
+ }
271
+ if (!scale || scale === 1) {
218
272
  return { value: rawValue, values: rawValues };
219
273
  }
220
- const convertNum = (v) => {
221
- const n = typeof v === 'number' ? v : parseFloat(String(v));
222
- return Number.isFinite(n) ? n * effectiveScale : null;
223
- };
224
- const converted = (() => {
225
- const c = convertNum(rawValue);
226
- return c == null ? rawValue : c;
227
- })();
228
- const values = Array.isArray(rawValues)
229
- ? rawValues.map((v) => {
230
- const c = convertNum(v);
231
- return c == null ? String(v) : String(c);
232
- })
233
- : rawValues;
234
- return { value: converted, values };
274
+ // Untyped members of unknown type — keep raw values and append
275
+ // length-scaled copies for every numeric candidate so either unit space
276
+ // matches.
277
+ const expanded = [];
278
+ for (const v of rawValues) {
279
+ expanded.push(String(v));
280
+ const c = convertNumeric(v, { scale, offset: 0 });
281
+ if (c != null && String(c) !== String(v))
282
+ expanded.push(String(c));
283
+ }
284
+ return { value: rawValue, values: expanded };
235
285
  }
236
286
  //# sourceMappingURL=units.js.map