Skip to content

Commit 7bb9ceb

Browse files
Merge branch 'develop' into Rudresh-sisode-patch-1
2 parents 305bac7 + 221502c commit 7bb9ceb

File tree

7 files changed

+103
-59
lines changed

7 files changed

+103
-59
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ updates:
66
interval: daily
77
time: "10:00"
88
timezone: Europe/Budapest
9-
open-pull-requests-limit: 5
9+
open-pull-requests-limit: 0
1010
versioning-strategy: increase
1111
commit-message:
1212
prefix: build

.github/workflows/continuous-integration-workflow.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ jobs:
2727
node-version: ${{ matrix.node-version }}
2828
- run: npm ci --ignore-scripts
2929
- run: npm run test:ci
30-
- run: npm install codecov -g
31-
if: ${{ matrix.node-version == 'current' }}
32-
- run: codecov -f ./coverage/clover.xml -t ${{ secrets.CODECOV_TOKEN }} --commit=$GITHUB_SHA --branch=${GITHUB_REF##*/}
33-
if: ${{ matrix.node-version == 'current' }}
30+
- name: Upload coverage to Codecov
31+
uses: codecov/codecov-action@v5
32+
if: ${{ matrix.node-version == 'current' && github.actor != 'dependabot[bot]' }}
33+
with:
34+
files: ./coverage/clover.xml
35+
directory: ./coverage/lcov-report/
36+
token: ${{ secrets.CODECOV_TOKEN }}
37+
verbose: true
38+
fail_ci_if_error: true
3439
build:
3540
name: Build
3641
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
22

33
_This changelog follows the [keep a changelog][keep-a-changelog]_ format to maintain a human readable changelog.
44

5+
## [0.14.2](https://github.com/typestack/class-validator/compare/v0.14.1...v0.14.2) (2025-05-02)
6+
7+
#### Fixed
8+
9+
- Fixed an issue where `forbidUnknownValues` did not default to `true` when `validatorOptions` was undefined. ([#2196](https://github.com/typestack/class-validator/pull/2196) by [@cduff](https://github.com/cduff))
10+
- Fixed the `ValidationMetadata.name` property to work correctly with the `@IsOptional` decorator. ([#2044](https://github.com/typestack/class-validator/pull/2044) by [@Clashsoft](https://github.com/Clashsoft))
11+
- Updated the Codecov configuration for continuous integration. ([#2556](https://github.com/typestack/class-validator/pull/2556) by [@haiweilian](https://github.com/haiweilian))
12+
- Fixed an issue where options were not passed correctly to the `@IsBase64` decorator. ([#2549](https://github.com/typestack/class-validator/pull/2549) by [@aseyfpour](https://github.com/aseyfpour))
13+
- Fixed argument handling for the `isBase64` function. ([#2574](https://github.com/typestack/class-validator/pull/2574) by [@braaar](https://github.com/braaar))
14+
15+
### [0.14.1](https://github.com/typestack/class-validator/compare/v0.14.0...v0.14.1) (2024-01-12)
16+
17+
#### Added
18+
19+
- allow specifying options for `@IsBase64` decorator ([#1845](https://github.com/typestack/class-validator/issues/1845)) , closes [#1013](https://github.com/typestack/class-validator/issues/1013)
20+
- use official type for version in `@IsUUID` decorator ([#1846](https://github.com/typestack/class-validator/issues/1846)) , closes [#1497](https://github.com/typestack/class-validator/issues/1497)
21+
- update `@IsPhoneNumber` decorator to use max dataset ([#1857](https://github.com/typestack/class-validator/issues/1857))
22+
23+
#### Fixed
24+
25+
- fail for non-array constraint in `@IsIn` decorator ([#1844](https://github.com/typestack/class-validator/issues/1844)) , closes [#1693](https://github.com/typestack/class-validator/issues/1693)
26+
- allow number and boolean values in validation message "$value" tokens ([#1467](https://github.com/typestack/class-validator/issues/1467)) , closes [#921](https://github.com/typestack/class-validator/issues/921), [#1046](https://github.com/typestack/class-validator/issues/1046)
27+
- read nullable option in `@IsNotEmptyObject` decorator correctly ([#1555](https://github.com/typestack/class-validator/issues/1555)) , closes [#1554](https://github.com/typestack/class-validator/issues/1554)
28+
29+
#### Changed
30+
31+
- update `libphonenumber-js` to `^1.10.53` from `^1.10.14`
32+
- update various dev-dependencies
33+
534
### [0.14.0](https://github.com/typestack/class-validator/compare/v0.13.2...v0.14.0) (2022-12-09)
635

736
### Added

package-lock.json

Lines changed: 44 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "class-validator",
3-
"version": "0.14.1",
3+
"version": "0.14.2",
44
"description": "Decorator-based property validation for classes.",
55
"author": "TypeStack contributors",
66
"license": "MIT",
@@ -37,14 +37,14 @@
3737
},
3838
"dependencies": {
3939
"@types/validator": "^13.11.8",
40-
"libphonenumber-js": "^1.10.58",
40+
"libphonenumber-js": "^1.11.1",
4141
"validator": "^13.9.0"
4242
},
4343
"devDependencies": {
4444
"@rollup/plugin-commonjs": "^25.0.7",
4545
"@rollup/plugin-node-resolve": "^15.2.3",
4646
"@types/jest": "^29.5.12",
47-
"@types/node": "^20.11.30",
47+
"@types/node": "^20.12.10",
4848
"@typescript-eslint/eslint-plugin": "^5.62.0",
4949
"@typescript-eslint/parser": "^5.62.0",
5050
"eslint": "^8.57.0",
@@ -54,12 +54,12 @@
5454
"jest": "^29.7.0",
5555
"lint-staged": "^15.2.2",
5656
"prettier": "^2.8.8",
57-
"reflect-metadata": "0.2.1",
57+
"reflect-metadata": "0.2.2",
5858
"rimraf": "5.0.5",
5959
"rollup": "^2.79.1",
6060
"rollup-plugin-terser": "^7.0.2",
6161
"ts-jest": "^29.1.2",
6262
"ts-node": "^10.9.2",
63-
"typescript": "^5.4.3"
63+
"typescript": "^5.4.5"
6464
}
6565
}

src/decorator/string/IsBase64.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function IsBase64(
2626
name: IS_BASE64,
2727
constraints: [options],
2828
validator: {
29-
validate: (value, args): boolean => isBase64(value),
29+
validate: (value, args): boolean => isBase64(value, args?.constraints[0]),
3030
defaultMessage: buildMessage(eachPrefix => eachPrefix + '$property must be base64 encoded', validationOptions),
3131
},
3232
},

test/functional/validation-functions-and-decorators.spec.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,17 +1658,27 @@ describe('IsBase64', () => {
16581658
const validValues = ['aGVsbG8='];
16591659
const invalidValues = [null, undefined, 'hell*mynameisalex'];
16601660

1661+
const validBase64UrlValues = ['dGVzdA', 'dGV_zdA'];
1662+
const invalidBase64UrlValues = [null, undefined, 'dGVzdA=', 'MTIzNDU2Nzg5!!', 'SGVsbG8+V29ybGQ='];
1663+
16611664
class MyClass {
16621665
@IsBase64()
16631666
someProperty: string;
16641667
}
16651668

1666-
it('should not fail if validator.validate said that its valid', () => {
1667-
return checkValidValues(new MyClass(), validValues);
1669+
class MyClassWithConstraint {
1670+
@IsBase64({ urlSafe: true })
1671+
someProperty: string;
1672+
}
1673+
1674+
it('should not fail if validator.validate said that its valid', async () => {
1675+
await checkValidValues(new MyClass(), validValues);
1676+
await checkValidValues(new MyClassWithConstraint(), validBase64UrlValues);
16681677
});
16691678

1670-
it('should fail if validator.validate said that its invalid', () => {
1671-
return checkInvalidValues(new MyClass(), invalidValues);
1679+
it('should fail if validator.validate said that its invalid', async () => {
1680+
await checkInvalidValues(new MyClass(), invalidValues);
1681+
await checkInvalidValues(new MyClassWithConstraint(), invalidBase64UrlValues);
16721682
});
16731683

16741684
it('should not fail if method in validator said that its valid', () => {

0 commit comments

Comments
 (0)