Skip to content
Snippets Groups Projects
Commit 1a358c86 authored by Giuseppe's avatar Giuseppe
Browse files

Removed unused util methods

parent c6ce4208
No related branches found
No related tags found
No related merge requests found
......@@ -93,51 +93,6 @@ export const hasValueOperator = () =>
<T>(source: Observable<T>): Observable<T> =>
source.pipe(filter((obj: T) => hasValue(obj)));
/**
* Returns true if the passed value is null or undefined.
* hasUndefinedValue(); // false
* hasUndefinedValue(null); // false
* hasUndefinedValue(undefined); // false
* hasUndefinedValue(''); // true
* hasUndefinedValue({undefined, obj}); // true
* hasUndefinedValue([undefined, val]); // true
*/
export function hasUndefinedValue(obj?: any): boolean {
let result = false;
if (isUndefined(obj) || isNull(obj)) {
return false;
}
const objectType = typeof obj;
if (objectType === 'object') {
if (Object.keys(obj).length === 0) {
return false;
}
Object.entries(obj).forEach(([key, value]) => {
if (isUndefined(value)) {
result = true
}
})
}
return result;
}
/**
* Returns true if the passed value is null or undefined.
* hasUndefinedValue(); // true
* hasUndefinedValue(null); // true
* hasUndefinedValue(undefined); // true
* hasUndefinedValue(''); // false
* hasUndefinedValue({undefined, obj}); // false
* hasUndefinedValue([undefined, val]); // false
*/
export function hasNoUndefinedValue(obj?: any): boolean {
return !hasUndefinedValue(obj);
}
/**
* Verifies that a value is `null` or an empty string, empty array,
* or empty function.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment