( name: string, param?: TokenList, )
| 487 | } |
| 488 | |
| 489 | function functionAnnotation( |
| 490 | name: string, |
| 491 | param?: TokenList, |
| 492 | ): Expression["annotation"] { |
| 493 | const options: FunctionReference["options"] = []; |
| 494 | const style = param |
| 495 | ? serializeTokens(param, { inPlural: false }).trim() |
| 496 | : undefined; |
| 497 | if (style && style.length > 0) { |
| 498 | options.push({ name: "style", value: { type: "literal", value: style } }); |
| 499 | } |
| 500 | |
| 501 | return { |
| 502 | type: "function-reference", |
| 503 | name, |
| 504 | options, |
| 505 | }; |
| 506 | } |
| 507 | |
| 508 | function serializeTokens( |
| 509 | tokens: TokenList, |
no test coverage detected