© 2026 Hedgehog Software, LLC
const CookieName = NonEmptyTrimmedString.pipe( Schema.filter(name => !RESERVED_COOKIE_NAMES.test(name), { message: () => "Reserved cookie name", }), Schema.maxLength(COOKIE.MAX_LENGTH.name), Schema.pattern(COOKIE.REGEX.name, { message: () => "Invalid RFC 6265 cookie name", }), Schema.brand("CookieName"), )
Schema.pattern
Schema.filter
const RESERVED_COOKIE_NAMES = /^(?:valueOf|toString|constructor|__proto__|hasOwnProperty|isPrototypeOf|propertyIsEnumerable)$/