1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-06-16 13:46:16 +02:00

Disable default styles for number input

This commit is contained in:
Maciej Lenartowicz
2019-09-25 11:59:45 +00:00
parent 7371fbcac0
commit 7253319b61
6 changed files with 105 additions and 13 deletions

View File

@ -0,0 +1,20 @@
/** Return undefined if object has no keys, otherwise return object. */
export function undefinedIfEmpty(instance) {
if (Object.keys(instance).length > 0) {
return instance;
}
return undefined;
}
/** Return object without keys that have undefined value. */
export function withoutUndefinedKeys(instance) {
return Object.keys(instance).reduce(
(accumulator, key) => {
if (instance[key] !== undefined) {
accumulator[key] = instance[key];
}
return accumulator;
},
{},
);
}