* Returns a new object with key values from source based on the keys. * `null` or `undefined` values are not copied. * @private * @param {object} source The object to pick values from. * @param {...string} keys One or more keys to copy from source. * @return {object} A new object with the requi
(source, ...keys)
| 1613 | */ |
| 1614 | |
| 1615 | function pickOnlyExistingValues(source, ...keys) { |
| 1616 | let result = {}; |
| 1617 | if (source) { |
| 1618 | keys.forEach((key) => { |
| 1619 | if (source[key] != null) { |
| 1620 | result[key] = source[key]; |
| 1621 | } |
| 1622 | }); |
| 1623 | } |
| 1624 | return result; |
| 1625 | } |
| 1626 | |
| 1627 | /** |
| 1628 | * Returns a JSON array as String. |
no outgoing calls
no test coverage detected