Browse Source

Update validation

Remove datelike schema.
master
TheoryOfNekomata 6 months ago
parent
commit
0f49ced7c7
1 changed files with 0 additions and 12 deletions
  1. +0
    -12
      packages/core/src/common/validation.ts

+ 0
- 12
packages/core/src/common/validation.ts View File

@@ -1,13 +1 @@
import * as v from 'valibot';
export * from 'valibot'; export * from 'valibot';

export const datelike = () => v.transform(
v.union([
v.string([v.isoDate()]),
v.string([v.isoDateTime()]),
v.number(),
v.date()
]),
(value) => new Date(value).toISOString(),
v.string([v.isoTimestamp()])
);

Loading…
Cancel
Save