diff --git a/lib-es5/utils/index.js b/lib-es5/utils/index.js index 3366a75d..74a3ba8d 100644 --- a/lib-es5/utils/index.js +++ b/lib-es5/utils/index.js @@ -1463,12 +1463,11 @@ function pickOnlyExistingValues(source) { keys[_key2 - 1] = arguments[_key2]; } - for (var j = 0; j < keys.length; j++) { - var key = keys[j]; + keys.forEach(function (key) { if (source[key] != null) { result[key] = source[key]; } - } + }); } return result; } diff --git a/lib/utils/index.js b/lib/utils/index.js index b41190ba..ee3b242f 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -1333,12 +1333,11 @@ function present(value) { function pickOnlyExistingValues(source, ...keys) { let result = {}; if (source) { - for (let j = 0; j < keys.length; j++) { - let key = keys[j]; + keys.forEach((key) => { if (source[key] != null) { result[key] = source[key]; } - } + }); } return result; }