/**
 * Serializes an arbitrary value to a string. Used where a prop accepts
 * `any` (radio values, select values, etc.) but the DOM needs a string —
 * e.g. a hidden `<input value>`.
 *
 * - `null`/`undefined` serialize to the empty string.
 * - Strings pass through untouched (no JSON quoting).
 * - Everything else goes through `JSON.stringify`, falling back to
 *   `String(value)` for cyclic or otherwise non-stringifiable input.
 */
export function serializeValue(value) {
  if (value == null) {
    return "";
  }
  if (typeof value === "string") {
    return value;
  }
  try {
    return JSON.stringify(value);
  } catch {
    return String(value);
  }
}
//# sourceMappingURL=serialize-value.jsx.map
