MCPcopy Index your code
hub / github.com/banga/git-split-diffs / getContextForConfig

Function getContextForConfig

src/context.ts:17–42  ·  view source on GitHub ↗
(
    config: Config,
    chalk: ChalkInstance,
    screenWidth: number
)

Source from the content-addressed store, hash-verified

15};
16
17export async function getContextForConfig(
18 config: Config,
19 chalk: ChalkInstance,
20 screenWidth: number
21): Promise<Context> {
22 const SCREEN_WIDTH = screenWidth;
23
24 const HORIZONTAL_SEPARATOR = T()
25 .fillWidth(SCREEN_WIDTH, '─')
26 .addSpan(0, SCREEN_WIDTH, config.BORDER_COLOR);
27
28 let HIGHLIGHTER = undefined;
29 if (config.SYNTAX_HIGHLIGHTING_THEME) {
30 HIGHLIGHTER = await shiki.createHighlighter({
31 themes: [config.SYNTAX_HIGHLIGHTING_THEME],
32 langs: [],
33 });
34 }
35 return {
36 ...config,
37 CHALK: chalk,
38 SCREEN_WIDTH,
39 HORIZONTAL_SEPARATOR,
40 HIGHLIGHTER,
41 };
42}

Callers 3

transformFunction · 0.90
mainFunction · 0.90
previewThemeFunction · 0.90

Calls 3

TFunction · 0.90
addSpanMethod · 0.80
fillWidthMethod · 0.80

Tested by 1

transformFunction · 0.72