# dateBefore Source: https://smartassertions.dev/matchers/dateBefore/ Index of every page: https://smartassertions.dev/llms.txt Matcher for a Date holding an instant earlier than the given one. Matchers are applied through assertObjectMatches, where they narrow the corresponding property type. ## Usage ```ts import { assertObjectMatches, dateBefore } from "@kensio/smartass"; const value: unknown = { createdAt: new Date("2026-01-01T00:00:00.000Z"), }; assertObjectMatches(value, { createdAt: dateBefore(new Date("2026-06-01T00:00:00.000Z")), }); // value is now narrowed to an object with a Date createdAt // { // createdAt: Date; // } ``` ## Source Source file: [`src/assert/date-before/date-before.match.ts`](https://github.com/KensioSoftware/smartass/blob/main/src/assert/date-before/date-before.match.ts)