function parseCategoryIds
parseCategoryIds(value: FormDataEntryValue | null): string[]

Parses a multipart form's categoryIds, a JSON array sent as a string. A missing or malformed value counts as no category. The dumps and files routes read the forms that post and replace a file with it.

Parameters

value: FormDataEntryValue | null

Return Type

string[]

Usage

import { parseCategoryIds } from "api/validators/dump.ts";