File tree Expand file tree Collapse file tree 6 files changed +30
-14
lines changed
Expand file tree Collapse file tree 6 files changed +30
-14
lines changed Original file line number Diff line number Diff line change 33All notable changes to this project will be documented in this file.
44
55## Unreleased
6+ ---
7+ ### 3.4.7 - 2023-01-19
8+
9+ ### Update
10+
11+ - rich-domain: update lib core to 1.16.2
612
713---
814### 3.4.6 - 2023-01-18
915
10- ### Added
16+ ### Update
1117
1218- rich-domain: update lib core to 1.16.1
1319
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { ValueObject } from '../core';
22import { Result } from '../core' ;
33import isValidCpfDigit , {
44 formatValueToCpfPattern ,
5- removeSpecialCharsFromCpf ,
65} from './check-cpf-digit.util' ;
76const regexCpf =
87 / ^ ( [ 0 - 9 ] { 3 } ) [ \. ] ( (? ! \1) [ 0 - 9 ] { 3 } ) [ \. ] ( [ 0 - 9 ] { 3 } ) [ - ] ( [ 0 - 9 ] { 2 } ) $ | ^ [ 0 - 9 ] { 11 } $ / ;
@@ -36,7 +35,9 @@ export class CPFValueObject extends ValueObject<Prop> {
3635 * @example after "52734865211"
3736 */
3837 removeSpecialChars ( ) : CPFValueObject {
39- this . props . value = removeSpecialCharsFromCpf ( this . props . value ) ;
38+ this . props . value = this . util
39+ . string ( this . props . value )
40+ . removeSpecialChars ( ) ;
4041 return this ;
4142 }
4243
@@ -58,8 +59,10 @@ export class CPFValueObject extends ValueObject<Prop> {
5859 * @example param "527.348.652-11"
5960 */
6061 compare ( cpf : string ) : boolean {
61- const formattedCpf = removeSpecialCharsFromCpf ( cpf ) ;
62- const instanceValue = removeSpecialCharsFromCpf ( this . props . value ) ;
62+ const formattedCpf = this . util . string ( cpf ) . removeSpecialChars ( ) ;
63+ const instanceValue = this . util
64+ . string ( this . props . value )
65+ . removeSpecialChars ( ) ;
6366 return instanceValue === formattedCpf ;
6467 }
6568
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ class CurrencyValueObject extends ValueObject<Prop> {
209209 * @returns boolean true if instance value is positive else false
210210 */
211211 isPositive ( ) : boolean {
212- return this . cents >= 0 ;
212+ return this . validator . number ( this . cents ) . isPositive ( ) ;
213213 }
214214
215215 validation ( _value : any , _key : any ) : boolean {
Original file line number Diff line number Diff line change @@ -38,7 +38,11 @@ export class UserNameValueObject extends ValueObject<Prop> {
3838 name [ 0 ] . toUpperCase ( ) + name . slice ( 1 ) . toLowerCase ( ) ;
3939 capitalized . push ( lowerCaseName ) ;
4040 }
41- this . props . value = capitalized . toString ( ) . replace ( / , / g, ' ' ) ;
41+ const value = this . util
42+ . string ( capitalized . toString ( ) )
43+ . replace ( ',' )
44+ . to ( ' ' ) ;
45+ this . props . value = value ;
4246 return this ;
4347 }
4448
@@ -94,7 +98,10 @@ export class UserNameValueObject extends ValueObject<Prop> {
9498 getInitials ( ) : string {
9599 const names = this . props . value . split ( ' ' ) ;
96100 const letters = names . map ( ( name ) => name [ 0 ] ) ;
97- const initials = letters . toString ( ) . replace ( / , / g, '.' ) ;
101+ const initials = this . util
102+ . string ( letters . toString ( ) )
103+ . replace ( ',' )
104+ . to ( '.' ) ;
98105 return initials ;
99106 }
100107
Original file line number Diff line number Diff line change 11{
22 "name" : " types-ddd" ,
3- "version" : " 3.4.6 " ,
3+ "version" : " 3.4.7 " ,
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" ,
6161 "bcrypt" : " ^5.0.1" ,
6262 "pino" : " ^8.8.0" ,
6363 "pino-pretty" : " ^9.1.1" ,
64- "rich-domain" : " ^1.16.1 "
64+ "rich-domain" : " ^1.16.2 "
6565 },
6666 "devDependencies" : {
6767 "@microsoft/tsdoc" : " ^0.14.1" ,
Original file line number Diff line number Diff line change @@ -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.16.1 :
3413- version "1.16.1 "
3414- resolved "https://registry.yarnpkg.com/rich-domain/-/rich-domain-1.16.1 .tgz#c0fb9d0873832fc0ee2d6934ef4f25d59f1dbd3a "
3415- integrity sha512-P+EncFwF8iGnl2BaCnVRUnDw7aLywNT9j2r6ty5pKWU/ZevsWJUYz4KrI6i1Y+rKtSe6kD1IpRpblkCAOQgunA ==
3412+ rich-domain@^1.16.2 :
3413+ version "1.16.2 "
3414+ resolved "https://registry.yarnpkg.com/rich-domain/-/rich-domain-1.16.2 .tgz#37945d29128eb95b7bba894fe4b31ab70d233cbd "
3415+ integrity sha512-yqqViDG0oJcfzbcxU9OymraUspb4p7oT/8uheDX1U7Nw4lsG2N7JRaeHZ9nJp4d7VTu0hccBbP3byKCYfrB2YA ==
34163416
34173417rimraf@^3.0.0, rimraf@^3.0.2 :
34183418 version "3.0.2"
You can’t perform that action at this time.
0 commit comments