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

    Function extractRows

    • Extract the row array from a MUDAB response. The API returns a single-key object wrapping the array. The key is not reliably the path name (e.g. /STATION_SMALL -> key V_STATION_SMALL), but it is fixed per resource: for a path in WRAPPER_KEYS only that key is accepted, for any other path any one key. A bare array is taken as is. Every row must be a JSON object, and no field a number beyond the range of a double (JSON.parse makes it Infinity, printed as null).

      Anything else — an error envelope ({"errors":[…]}) or error object sent with status 200, another table's rows, a second key, null, a string, a row that is not an object — throws a MudabParseError naming what came back, so a server-side failure never reads as data or as an empty result. (The client's list methods report an error envelope as a MudabApiError with its messages before this runs.) The message starts with request, the request the answer came from (POST <url>, userinfo redacted; the client passes it), by default POST <path>. scrub removes credentials from the server text the message quotes (a key, a message, a field name) before it is cut; the client passes the engine's, which knows the base URL's userinfo.

      Type Parameters

      • T

      Parameters

      • res: unknown
      • Optionalpath: string
      • request: string = ...
      • scrub: (text: string) => string = ...

      Returns T[]