( style: Record<string, string>, props: readonly string[], id: string, context: VariableProjectionContext, format: VariableFormatter, readers: FigmaLookupReaders )
| 244 | } |
| 245 | |
| 246 | function applyVariableToProps( |
| 247 | style: Record<string, string>, |
| 248 | props: readonly string[], |
| 249 | id: string, |
| 250 | context: VariableProjectionContext, |
| 251 | format: VariableFormatter, |
| 252 | readers: FigmaLookupReaders |
| 253 | ): void { |
| 254 | if (!props.some((prop) => prop in style)) return |
| 255 | |
| 256 | const variable = resolveContextVariable(id, context, readers) |
| 257 | if (!variable) return |
| 258 | const value = format(variable) |
| 259 | if (!value) return |
| 260 | |
| 261 | props.forEach((prop) => { |
| 262 | if (!(prop in style)) return |
| 263 | style[prop] = value |
| 264 | }) |
| 265 | } |
| 266 | |
| 267 | function resolveContextVariable( |
| 268 | id: string, |
no test coverage detected