applyParameterDefinitions = (inputParameters, parameterDefinitions, throwOnNoDefinition = false) => {
  const values = Object.keys(inputParameters).reduce((paramValues, paramName) => {
    let value = inputParameters[paramName]

    const definitions = parameterDefinitions.filter((definition) => definition.name === paramName)
    const definition = definitions.length > 0 ? definitions[0] : { type: 'unknown' }

    switch (definition.type) {
      case 'choice':
        value = valueForChoices(value, definition)
        break
      case 'float':
      case 'number':
        if (!isNaN(parseFloat(value)) && isFinite(value)) {
          value = parseFloat(value)
        } else {
          throw new Error('Parameter (' + paramName + ') is not a valid number (' + value + ')')
        }
        break
      case 'int':
        if (!isNaN(parseFloat(value)) && isFinite(value)) {
          value = parseInt(value)
        } else {
          throw new Error('Parameter (' + paramName + ') is not a valid number (' + value + ')')
        }
        break
      case 'checkbox':
        value = !!value
        break
      case 'radio':
        value = valueForChoices(value, definition)
        break
      case 'slider':
        if (!isNaN(parseFloat(value)) && isFinite(value)) {
          value = parseFloat(value)
        } else {
          throw new Error('Parameter (' + paramName + ') is not a valid number (' + value + ')')
        }
        break
      default:
        if (throwOnNoDefinition) {
          throw new Error(`Parameter (${paramName}) has no matching definition`)
        }
        break
    }
    paramValues[paramName] = value
    return paramValues
  }, {})
  return values
}
casts the parameters/ get their correct values based on the
raw parameters (passed into the CLI tool for example) and the
parameter defintions as present in the jscad script
@param {Object} inputParameters: input parameter as an object {paramName: paramValue}
@param {Array} parameterDefinitions
@returns {Object} the parameter values, as an object