(options)
| 5 | const { FST_ERR_INIT_OPTS_INVALID } = require('./errors') |
| 6 | |
| 7 | function 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 | |
| 19 | function deepFreezeObject (object) { |
| 20 | const properties = Object.getOwnPropertyNames(object) |
nothing calls this directly
no test coverage detected