Skip to content

Commit

Permalink
Fix normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Dec 26, 2021
1 parent 84735fd commit dff1c43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/config/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ const checkString = function (value, name) {
}
}

export const checkStringsObject = function (value, name) {
checkObject(value, name)
Object.entries(value).forEach(([childName, propValue]) => {
checkString(propValue, `${name}.${childName}`)
})
}

export const checkJsonDeepObject = function (value, name) {
checkObject(value, name)
Object.entries(value).forEach(([childName, propValue]) => {
Expand Down
3 changes: 2 additions & 1 deletion src/config/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { parseLimits } from '../history/compare/parse.js'
import { normalizePrecision } from '../run/precision.js'

import {
checkStringsObject,
normalizeOptionalArray,
checkArrayLength,
checkStringArray,
Expand All @@ -27,7 +28,7 @@ const normalizeProp = function (config, [propName, normalizer]) {
}

const normalizeSystem = function (system) {
return { systemId: system }
checkStringsObject(system, 'system')
}

const normalizeRunner = function (value, propName) {
Expand Down

0 comments on commit dff1c43

Please sign in to comment.