Skip to content

parseAsHex

const parseAsHex: Parser<number>;

Defined in: tanstack/core/built-in-parsers.ts:86

Integer stored as hexadecimal (no 0x prefix), e.g. for colors. Serializes rounded.

import { parseAsHex } from "@xtandard/lib/tanstack";
parseAsHex.parse("ff"); // → 255
parseAsHex.serialize(255); // → "ff"
parseAsHex.parse("zz"); // → null