(jsPath string, flags Flag)
| 456 | } |
| 457 | |
| 458 | func insertSidebarConfig(jsPath string, flags Flag) { |
| 459 | if !flags.SidebarConfig { |
| 460 | return |
| 461 | } |
| 462 | |
| 463 | utils.ModifyFile(jsPath, func(content string) string { |
| 464 | utils.ReplaceOnce( |
| 465 | &content, |
| 466 | `return null!=\w+&&\w+\.totalLength(\?\w+\(\)\.createElement\(\w+,\{contextUri:)(\w+)\.uri`, |
| 467 | func(submatches ...string) string { |
| 468 | return fmt.Sprintf(`return true%s%s?.uri||""`, submatches[1], submatches[2]) |
| 469 | }) |
| 470 | |
| 471 | return content |
| 472 | }) |
| 473 | } |
| 474 | |
| 475 | func insertExpFeatures(jsPath string, flags Flag) { |
| 476 | if !flags.ExpFeatures { |
nothing calls this directly
no test coverage detected