All files / js/utils type.js

56.25% Statements 9/16
15.38% Branches 2/13
33.33% Functions 2/6
58.33% Lines 7/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161x 2x 1x 1x 1x               1x 1x    
export const isFunction = unknown => typeof unknown === 'function';
export const isString = unknown => (typeof unknown === 'string' || ((!!unknown && typeof unknown === 'object') && Object.prototype.toString.call(unknown) === '[object String]'));
export const isDate = unknown => (Object.prototype.toString.call(unknown) === '[object Date]' || unknown instanceof Date) && !isNaN(unknown.valueOf());
export const isObject = unknown => ((typeof unknown === 'function' || (typeof unknown === 'object' && !!unknown)) && !Array.isArray(unknown));
export const isNode = unknown => {
	try {
		Node.prototype.cloneNode.call(unknown, false);
		return true;
	} catch (err) {
		return false;
	}
};
const falsy = /^(?:f(?:alse)?|no?|0+)$/i;
export const BooleanParse = function (val) {
	return !falsy.test(val) && !!val;
};