Skip to content

Commit 5a28f93

Browse files
authored
Merge branch 'develop' into develop
2 parents 3387091 + 0ea279b commit 5a28f93

File tree

5 files changed

+45
-11
lines changed

5 files changed

+45
-11
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ 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
1313
include: scope
1414
ignore:
15-
- dependency-name: "husky"
15+
- dependency-name: "husky"

.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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

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

5+
### [0.14.1](https://github.com/typestack/class-validator/compare/v0.14.0...v0.14.1) (2024-01-12)
6+
7+
#### Added
8+
9+
- 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)
10+
- 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)
11+
- update `@IsPhoneNumber` decorator to use max dataset ([#1857](https://github.com/typestack/class-validator/issues/1857))
12+
13+
#### Fixed
14+
15+
- 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)
16+
- 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)
17+
- 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)
18+
19+
#### Changed
20+
21+
- update `libphonenumber-js` to `^1.10.53` from `^1.10.14`
22+
- update various dev-dependencies
23+
524
### [0.14.0](https://github.com/typestack/class-validator/compare/v0.13.2...v0.14.0) (2022-12-09)
625

726
### Added

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)