(formatterid: string, source: string, options: FormatOptions)
| 44 | } |
| 45 | |
| 46 | public async format(formatterid: string, source: string, options: FormatOptions): Promise<UnprocessedExecResult> { |
| 47 | const formatter = this.getFormatterById(formatterid); |
| 48 | // Ensure the formatter exists |
| 49 | if (formatter === null) { |
| 50 | throw new Error(`Formatter ${formatterid} not found`); |
| 51 | } |
| 52 | // Ensure the formatting style is valid |
| 53 | if (!formatter.isValidStyle(options.baseStyle)) { |
| 54 | throw new Error(`Formatter ${formatterid} does not support style ${options.baseStyle}`); |
| 55 | } |
| 56 | return await formatter.format(source, options); |
| 57 | } |
| 58 | |
| 59 | public async initialize(ceProps: PropertyGetter): Promise<void> { |
| 60 | const formatters = _.compact(ceProps('formatters', '').split(':')); |
nothing calls this directly
no test coverage detected