From 34237618816ceefe47acb06180f96250e14f34dc Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 31 Dec 2019 23:36:55 +0100 Subject: [PATCH] cleanup todos --- UI/ActionManager.js | 1 - Uri/UriFactory.js | 1 - Utils/GeneralUtils.js | 12 ++++++++---- Utils/oLib.js | 12 ++++++++---- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/UI/ActionManager.js b/UI/ActionManager.js index dfcc343..988ca83 100644 --- a/UI/ActionManager.js +++ b/UI/ActionManager.js @@ -79,7 +79,6 @@ export class ActionManager return; } - // todo: validate json, if invalid log error const listeners = JSON.parse(e.getAttribute('data-action')), listenerLength = listeners.length, self = this; diff --git a/Uri/UriFactory.js b/Uri/UriFactory.js index a07a18b..54a317c 100644 --- a/Uri/UriFactory.js +++ b/Uri/UriFactory.js @@ -197,7 +197,6 @@ export class UriFactory } else if (match.indexOf('?') === 0) { return Http.getUriQueryParameter(current.query, match.substr(1)); } else if (match.indexOf('/') === 0) { - // todo: second match should return second path return 'ERROR PATH'; } else if (match === '%') { return window.location.href; diff --git a/Utils/GeneralUtils.js b/Utils/GeneralUtils.js index 362f067..12376cc 100644 --- a/Utils/GeneralUtils.js +++ b/Utils/GeneralUtils.js @@ -64,13 +64,17 @@ }; /** - * todo: implement deep clone/copy - * @param obj - * @returns {*} + * Shallow clones an object. + * + * @param {Object} obj Object to clone + * + * @returns {Object} + * + * @since 1.0.0 */ jsOMS.clone = function (obj) { - return obj; + return { ...obj }; }; /** diff --git a/Utils/oLib.js b/Utils/oLib.js index 60f8d37..3333e6d 100644 --- a/Utils/oLib.js +++ b/Utils/oLib.js @@ -471,13 +471,17 @@ }; /** - * todo: implement deep clone/copy - * @param obj - * @returns {*} + * Shallow clones an object. + * + * @param {Object} obj Object to clone + * + * @returns {Object} + * + * @since 1.0.0 */ jsOMS.clone = function (obj) { - return obj; + return { ...obj }; }; jsOMS.isset = function (variable)