Skip to content

Commit d6aaf0b

Browse files
committed
feat(utils): rename date.value-object method
rename from isEqual to isEqualDate
1 parent 36df6ab commit d6aaf0b

File tree

6 files changed

+26
-17
lines changed

6 files changed

+26
-17
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased
66

7+
### 3.4.5 - 2023-01-14
8+
9+
### Changed
10+
11+
- date.value-object: rename method from `isEqual` to `isEqualDate`
12+
13+
### Update
14+
15+
- rich-domain: update lib core to 1.16.0
16+
- Entity: added method isEqual to compare current instance with another one.
17+
- ValueObject: added method isEqual to compare current instance with another one. [Issue 27](https://github.com/4lessandrodev/rich-domain/issues/27)
18+
19+
---
20+
721
### 3.4.4 - 2023-01-12
822

923
### Added

docs/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,17 +1194,12 @@ You can compare two entities.
11941194

11951195
```ts
11961196

1197-
const isEqual = user1.equal(user2);
1197+
const isEqual = user1.isEqual(user2);
11981198

11991199
console.log(isEqual);
12001200

12011201
> false
12021202

1203-
const isDeepEqual = user1.deepEqual(user2);
1204-
1205-
console.log(isDeepEqual);
1206-
1207-
> false
12081203

12091204
```
12101205

lib/utils/date-value-object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export class DateValueObject extends ValueObject<Prop> {
438438
* @param date as Date
439439
* @returns true or false. True if instance date is equal to provided value
440440
*/
441-
isEqual(date: Date): boolean {
441+
isEqualDate(date: Date): boolean {
442442
const time = date.getTime();
443443
const instanceTime = this.props.value.getTime();
444444
return instanceTime === time;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "types-ddd",
3-
"version": "3.4.4",
3+
"version": "3.4.5",
44
"description": "This package provide utils file and interfaces to assistant build a complex application with domain driving design",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -61,7 +61,7 @@
6161
"bcrypt": "^5.0.1",
6262
"pino": "^8.8.0",
6363
"pino-pretty": "^9.1.1",
64-
"rich-domain": "^1.15.2"
64+
"rich-domain": "^1.16.0"
6565
},
6666
"devDependencies": {
6767
"@microsoft/tsdoc": "^0.14.1",

tests/utils/date.value-object.util.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,6 @@ describe('date.value-object', () => {
300300
const date = DateValueObject.create(
301301
new Date('2022-01-02 00:00:00')
302302
).value();
303-
expect(date.isEqual(new Date('2021-01-01 00:00:00'))).toBe(false);
303+
expect(date.isEqualDate(new Date('2021-01-01 00:00:00'))).toBe(false);
304304
});
305305
});

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,9 +3232,9 @@ prelude-ls@~1.1.2:
32323232
integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==
32333233

32343234
prettier@^2.8.1:
3235-
version "2.8.2"
3236-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.2.tgz#c4ea1b5b454d7c4b59966db2e06ed7eec5dfd160"
3237-
integrity sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw==
3235+
version "2.8.3"
3236+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.3.tgz#ab697b1d3dd46fb4626fbe2f543afe0cc98d8632"
3237+
integrity sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==
32383238

32393239
pretty-format@^27.0.0, pretty-format@^27.5.1:
32403240
version "27.5.1"
@@ -3409,10 +3409,10 @@ rfdc@^1.3.0:
34093409
resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b"
34103410
integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==
34113411

3412-
rich-domain@^1.15.2:
3413-
version "1.15.2"
3414-
resolved "https://registry.yarnpkg.com/rich-domain/-/rich-domain-1.15.2.tgz#21821cbbdd1b15e0fa97e36b2fabcb9f4f69df3d"
3415-
integrity sha512-AoI3rZLI+CI3PHy4bwqRQ9XU/eK8+ZNuSunHc/e4sIg1nVblGUZYFZA3Jj+eiHv5UyYbOANsZVNMJB44aW2Dvg==
3412+
rich-domain@^1.16.0:
3413+
version "1.16.0"
3414+
resolved "https://registry.yarnpkg.com/rich-domain/-/rich-domain-1.16.0.tgz#2727327135ebe7eda49a74d7f571c061a5162a08"
3415+
integrity sha512-vinkeIvPBbFZLKfEqKL1afSLoIJsxaQqe1tsRBj2a/riInBhs37QtsbFCmywNANzQwXn4aouont+vQpJZtiUJQ==
34163416

34173417
rimraf@^3.0.0, rimraf@^3.0.2:
34183418
version "3.0.2"

0 commit comments

Comments
 (0)