Browse Source
Bugfix/handle value nullifcation for undefined object (#2064)
* Handle undefined object
* Update changelog
pull/2065/head
Thomas Kaul
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/helper/object.helper.ts
|
|
@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
- Improved the language localization for French (`fr`) |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed an issue with the value nullification related to the investment streaks |
|
|
|
|
|
|
|
## 1.278.0 - 2023-06-09 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
@ -16,9 +16,11 @@ export function hasNotDefinedValuesInObject(aObject: Object): boolean { |
|
|
|
export function nullifyValuesInObject<T>(aObject: T, keys: string[]): T { |
|
|
|
const object = cloneDeep(aObject); |
|
|
|
|
|
|
|
keys.forEach((key) => { |
|
|
|
object[key] = null; |
|
|
|
}); |
|
|
|
if (object) { |
|
|
|
keys.forEach((key) => { |
|
|
|
object[key] = null; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
return object; |
|
|
|
} |
|
|
|