(option: T)
| 99 | * Inject `props` into `option` for legacy usage |
| 100 | */ |
| 101 | export function injectPropsWithOption<T extends object>(option: T): T { |
| 102 | const newOption = { ...option }; |
| 103 | if (!('props' in newOption)) { |
| 104 | Object.defineProperty(newOption, 'props', { |
| 105 | get() { |
| 106 | warning( |
| 107 | false, |
| 108 | 'Return type is option instead of Option instance. Please read value directly instead of reading from `props`.', |
| 109 | ); |
| 110 | return newOption; |
| 111 | }, |
| 112 | }); |
| 113 | } |
| 114 | |
| 115 | return newOption; |
| 116 | } |
| 117 | |
| 118 | export const getSeparatedContent = (text: string, tokens: string[], end?: number): string[] => { |
| 119 | if (!tokens || !tokens.length) { |
no outgoing calls
no test coverage detected
searching dependent graphs…