Skip to content
Merged

Dev #33

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

### [v5.19.4](https://github.com/panates/valgen/compare/v5.19.3...v5.19.4) -
### [v5.19.5](https://github.com/panates/valgen/compare/v5.19.4...v5.19.5) -

#### 🪲 Fixes

- fix: Fixed "ms" serialization issue @Eray Hanoğlu

### [v5.19.4](https://github.com/panates/valgen/compare/v5.19.3...v5.19.4) - 20 January 2026

#### 🚀 New Features

Expand Down
981 changes: 504 additions & 477 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions 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": "5.19.4",
"version": "5.19.5",
"author": "Panates",
"license": "MIT",
"private": true,
Expand All @@ -17,20 +17,20 @@
"@panates/eslint-config-ts": "^2.0.7",
"@panates/tsconfig": "^2.0.7",
"@swc-node/register": "^1.11.1",
"@swc/core": "^1.15.8",
"@swc/helpers": "^0.5.18",
"@swc/core": "^1.15.13",
"@swc/helpers": "^0.5.19",
"@types/mocha": "^10.0.10",
"@types/node": "^25.0.9",
"@types/node": "^25.3.0",
"auto-changelog": "^2.5.0",
"c8": "^10.1.3",
"expect": "^30.2.0",
"globals": "^17.0.0",
"globals": "^17.3.0",
"husky": "^9.1.7",
"madge": "^8.0.0",
"mocha": "11.7.1",
"npm-check-updates": "^19.3.1",
"prettier": "^3.8.0",
"rimraf": "^6.1.2",
"npm-check-updates": "^19.4.1",
"prettier": "^3.8.1",
"rimraf": "^6.1.3",
"ts-cleanup": "^1.3.0",
"typescript": "^5.9.3"
},
Expand Down
8 changes: 5 additions & 3 deletions src/rules/type-rules/is-date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function isDateString(options?: IsDateStringOptions) {
options,
);
}
if (parsed.precision > precisionMaxIdx) {
if (parsed.precision > precisionMaxIdx && !(input instanceof Date)) {
context.fail(
_this,
`Maximum date precision should be ${precisionMax}`,
Expand Down Expand Up @@ -147,8 +147,10 @@ function coerceDateString(
String(d.getMinutes()).padStart(2, '0'),
String(d.getSeconds()).padStart(2, '0'),
];
if (precisionIndex >= 7 && d.getMilliseconds() > 0)
dateParts.push(String(d.getMilliseconds()).padStart(3, '0'));
if (precisionIndex >= 7)
if (d.getMilliseconds() > 0)
dateParts.push(String(d.getMilliseconds()).padStart(3, '0'));
else dateParts.push('');
if (precisionIndex >= 8) {
const tzOffset = d.getTimezoneOffset();
const tz =
Expand Down
1 change: 0 additions & 1 deletion src/rules/type-rules/is-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export function isEnum<T1>(
values = keys.reduce((a, k) => {
if (values[k] != null) a.push(values[k]);
return a;
// v => !(typeof v === 'number' && !keys.includes(String(v))),
}, [] as any[]);
}
const valObj = (Array.isArray(values) ? values : [values]).reduce<any>(
Expand Down
3 changes: 0 additions & 3 deletions support/package.cjs.json

This file was deleted.

3 changes: 0 additions & 3 deletions support/package.esm.json

This file was deleted.