(unit)
| 5191 | * or a "size" parse node containing a unit field) is valid. |
| 5192 | */ |
| 5193 | const validUnit = function validUnit(unit) { |
| 5194 | if (typeof unit !== "string") { |
| 5195 | unit = unit.unit; |
| 5196 | } |
| 5197 | |
| 5198 | return unit in ptPerUnit || unit in relativeUnit || unit === "ex"; |
| 5199 | }; |
| 5200 | /* |
| 5201 | * Convert a "size" parse node (with numeric "number" and string "unit" fields, |
| 5202 | * as parsed by functions.js argType "size") into a CSS em value for the |