@codegateinc/g-utils
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -67,3 +67,3 @@ "use strict"; | ||
const clearObject = subject => compose(fromPairs, subject => toPairs(subject).filter(([_, value]) => isDefined(value)))(subject); | ||
const clearObject = subject => compose(fromPairs, subject => toPairs(subject).filter(([_, value]) => isDefined(value) && value !== ''))(subject); | ||
@@ -70,0 +70,0 @@ exports.clearObject = clearObject; |
@@ -6,3 +6,3 @@ { | ||
"typings": "index.d.ts", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"main": "dist/index.js", | ||
@@ -9,0 +9,0 @@ "description": "This library is a package of useful functions", |
@@ -47,2 +47,22 @@ import { clearObject } from '../utils' | ||
}) | ||
it('should clear empty string', () => { | ||
const arg1 = { | ||
str1: '', | ||
str2: 'Test' | ||
} | ||
expect(clearObject(arg1)).toEqual({ | ||
str2: 'Test' | ||
}) | ||
}) | ||
it('should not clear zeros', () => { | ||
const arg1 = { | ||
str1: 1, | ||
str2: 0 | ||
} | ||
expect(clearObject(arg1)).toEqual(arg1) | ||
}) | ||
}) |
@@ -45,3 +45,3 @@ import { KeyValuePair, CondItem } from './types' | ||
subject => toPairs(subject) | ||
.filter(([_ ,value]) => isDefined(value)) | ||
.filter(([_ ,value]) => isDefined(value) && value !== '') | ||
)(subject) | ||
@@ -48,0 +48,0 @@ |
22562
489