@maschinenlesbar.org/ausbildungssuche-cli
    Preparing search index...

    Function validateSearchParams

    • Check search parameters before any request, and throw an AusbildungValidationError naming the first parameter that breaks a rule:

      • params must be a plain object, every key one of SEARCH_PARAMS (searchParamKeyProblem; options.allowUnknownFilters lifts that one rule) and every value a single value of its type, not an array;
      • every string parameter (sw, ids, orte, re, uk, bart, bt) must be non-blank (nonEmptyProblem);
      • sty, re, uk and bt must come from the API's closed value sets (styProblem, regionsProblem, radiusProblem, startCodesProblem), ids numeric comma-separated ids (idsProblem), bart one numeric training type (trainingTypeProblem), and orte must be Name_lon_lat (placeProblem);
      • orte and a km radius uk must be given together (placeAndRadiusProblem);
      • page must be a non-negative integer, size an integer in 1..MAX_PAGE_SIZE, and the page must lie inside the MAX_RESULT_WINDOW (pageProblem, sizeProblem, resultWindowProblem).

      undefined means "not set" and is never checked.

      Parameters

      Returns AusbildungSearchParams