Skip to content
Merged

Dev #47

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## Changelog

### [v6.2.1](https://github.com/panates/valgen/compare/v6.2.0...v6.2.1) -
### [v6.2.2](https://github.com/panates/valgen/compare/v6.2.1...v6.2.2) -

#### 🚀 New Features

- feat: Add `separators` option to `toDateString` for enhanced formatting customization @Eray Hanoğlu

### [v6.2.1](https://github.com/panates/valgen/compare/v6.2.0...v6.2.1) - 21 May 2026

#### 🚀 New Features

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "valgen",
"description": "Fast runtime type validator, converter and io (encoding/decoding) library",
"version": "6.2.1",
"version": "6.2.2",
"author": "Panates",
"license": "MIT",
"private": true,
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ const toDate = vg.isDate({ coerce: true });
const toDateStringValidators = new Map();
const toDateString = (
input: Date | string | number,
options?: ExecutionOptions & { trim?: vg.isDateString.Precision },
options?: ExecutionOptions & {
trim?: vg.isDateString.Precision;
separators?: boolean;
},
ctx?: Context,
) => {
const precisionMax = options?.trim ?? 'ms';
Expand All @@ -95,6 +98,7 @@ const toDateString = (
coerce: true,
precisionMax,
trim: true,
separators: options?.separators,
});
toDateStringValidators.set(precisionMax, validator);
}
Expand Down