({params, open, close, children, alwaysIndent})
| 238 | const IndentContext = React.createContext({small: '', large: ''}); |
| 239 | |
| 240 | export function Indent({params, open, close, children, alwaysIndent}) { |
| 241 | let {small, large} = useContext(IndentContext); |
| 242 | |
| 243 | if (params.length === 0) { |
| 244 | open = <span className="token punctuation">{open}</span>; |
| 245 | close = <span className="token punctuation">{close}</span>; |
| 246 | } else if (params.length > 2 || alwaysIndent) { |
| 247 | // Always indent. |
| 248 | open = <span className="token punctuation">{open.trimEnd() + '\n' + large + ' '}</span>; |
| 249 | close = <span className="token punctuation">{'\n' + large + close.trimStart()}</span>; |
| 250 | large += ' '; |
| 251 | small += ' '; |
| 252 | } else { |
nothing calls this directly
no outgoing calls
no test coverage detected