MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / makePolicy

Function makePolicy

src/config/viteLocalAliasPolicy.test.ts:12–39  ·  view source on GitHub ↗
({
  command = 'build',
  mode = 'production',
  env = {},
  localRendererExists = true,
  localToolboxExists = true,
}: {
  command?: string;
  mode?: string;
  env?: Record<string, string | undefined>;
  localRendererExists?: boolean;
  localToolboxExists?: boolean;
} = {})

Source from the content-addressed store, hash-verified

10}
11
12function makePolicy({
13 command = 'build',
14 mode = 'production',
15 env = {},
16 localRendererExists = true,
17 localToolboxExists = true,
18}: {
19 command?: string;
20 mode?: string;
21 env?: Record<string, string | undefined>;
22 localRendererExists?: boolean;
23 localToolboxExists?: boolean;
24} = {}) {
25 const localRendererPath = path.resolve(rootDir, '../../gsplat/webgpu/src');
26 const localToolboxPath = path.resolve(rootDir, '../../gsplat/packages/gs-toolbox/ts/src/index.ts');
27 const existingPaths = [
28 localRendererExists ? localRendererPath : null,
29 localToolboxExists ? localToolboxPath : null,
30 ].filter((targetPath): targetPath is string => Boolean(targetPath));
31
32 return resolveViteLocalAliasPolicy({
33 command,
34 mode,
35 env,
36 rootDir,
37 pathExists: makePathExists(existingPaths),
38 });
39}
40
41function slashPath(targetPath: string): string {
42 return targetPath.replaceAll('\\', '/');

Callers 1

Calls 3

makePathExistsFunction · 0.85
resolveMethod · 0.65

Tested by

no test coverage detected