MCPcopy Create free account
hub / github.com/effect-app/libs / renderPreset

Function renderPreset

packages/eslint-codegen-model/src/shared/codegen-block.ts:82–101  ·  view source on GitHub ↗
(
  options: BlockOptions,
  meta: CodegenMeta,
  fullSource?: string,
  resolver?: ModelTypeResolver
)

Source from the content-addressed store, hash-verified

80}
81
82export function renderPreset(
83 options: BlockOptions,
84 meta: CodegenMeta,
85 fullSource?: string,
86 resolver?: ModelTypeResolver
87): string {
88 const { preset, ...rest } = options
89 switch (preset) {
90 case "barrel":
91 return barrel({ meta, options: rest as Parameters<typeof barrel>[0]["options"] }, undefined)
92 case "meta":
93 return metaPreset({ meta, options: rest as Parameters<typeof metaPreset>[0]["options"] }, undefined)
94 case "model":
95 return model({ meta, options: rest as Parameters<typeof model>[0]["options"] }, fullSource, resolver)
96 case "modelFacade":
97 return modelFacade({ meta, options: rest as Parameters<typeof modelFacade>[0]["options"] })
98 default:
99 throw new Error(`Unknown codegen preset: ${preset}`)
100 }
101}

Callers 2

updateFileFunction · 0.90
ProgramFunction · 0.90

Calls 3

barrelFunction · 0.90
modelFunction · 0.90
modelFacadeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…