Add JSDoc description

This commit is contained in:
eouia
2022-04-26 17:37:23 +02:00
parent 0f39b7733c
commit 1d90c5e1fe
2 changed files with 6 additions and 3 deletions

View File

@@ -148,9 +148,12 @@ class WeatherObject {
}
/**
* Clone to simple object to prevent mutating and deprecated legacy library.
* Clone to simple object to prevent mutating and deprecation of legacy library.
*
* @returns {object} simple object cloned.
* Before being handed to other modules, mutable values must be cloned safely.
* Especially 'moment' object is not immutable, so original 'date', 'sunrise', 'sunset' could be corrupted or changed by other modules.
*
* @returns {object} plained object clone of original weatherObject
*/
simpleClone() {
const toFlat = ["date", "sunrise", "sunset"];