MCPcopy
hub / github.com/fastify/fastify / validateInitialConfig

Function validateInitialConfig

lib/initial-config-validation.js:7–17  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

5const { FST_ERR_INIT_OPTS_INVALID } = require('./errors')
6
7function validateInitialConfig (options) {
8 const opts = deepClone(options)
9
10 if (!validate(opts)) {
11 const error = new FST_ERR_INIT_OPTS_INVALID(JSON.stringify(validate.errors.map(e => e.message)))
12 error.errors = validate.errors
13 throw error
14 }
15
16 return deepFreezeObject(opts)
17}
18
19function deepFreezeObject (object) {
20 const properties = Object.getOwnPropertyNames(object)

Callers

nothing calls this directly

Calls 2

deepFreezeObjectFunction · 0.85
validateFunction · 0.70

Tested by

no test coverage detected