From 862420e434aedd79c4170bf24ca913558407b040 Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Thu, 21 Dec 2017 14:09:02 +0100 Subject: [PATCH] new generic function --- client/core/src/lib/fullEmpty.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 client/core/src/lib/fullEmpty.js diff --git a/client/core/src/lib/fullEmpty.js b/client/core/src/lib/fullEmpty.js new file mode 100644 index 000000000..64d82cdad --- /dev/null +++ b/client/core/src/lib/fullEmpty.js @@ -0,0 +1,9 @@ +import {module} from '../module'; + +const isFullEmpty = item => { + return (!item && item !== 0) || (typeof item === 'object' && !Object.keys(item).length); +}; + +export default isFullEmpty; +export const NAME = 'isFullEmpty'; +module.value(NAME, isFullEmpty);