MCPcopy
hub / github.com/vitejs/vite / resolveHttpsConfig

Function resolveHttpsConfig

packages/vite/src/node/http.ts:146–158  ·  packages/vite/src/node/http.ts::resolveHttpsConfig
(
  https: HttpsServerOptions | undefined,
)

Source from the content-addressed store, hash-verified

144}
145
146export async function resolveHttpsConfig(
147 https: HttpsServerOptions | undefined,
148): Promise<HttpsServerOptions | undefined> {
149 if (!https) return undefined
150
151 const [ca, cert, key, pfx] = await Promise.all([
152 readFileIfExists(https.ca),
153 readFileIfExists(https.cert),
154 readFileIfExists(https.key),
155 readFileIfExists(https.pfx),
156 ])
157 return { ...https, ca, cert, key, pfx }
158}
159
160async function readFileIfExists(value?: string | Buffer | any[]) {
161 if (typeof value === class="st">'string') {

Callers 2

previewFunction · 0.90
_createServerFunction · 0.90

Calls 1

readFileIfExistsFunction · 0.85

Tested by

no test coverage detected