Sha256: 692fb77cde22041ac7c3b180f7de85dc09ed7589d8941f186c00e43903f52945

Contents?: true

Size: 1.34 KB

Versions: 64

Compression:

Stored size: 1.34 KB

Contents

export const isFunction = unknown => typeof unknown === 'function';
export const isNumber = unknown => typeof unknown === "number";
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 isEmptyObject = unknown => {
	for (const name in unknown) {
		if (unknown.hasOwnProperty(name)) {
			return false;
		}
	}
	return true;
};


export const isNode = unknown => !!(unknown && unknown.nodeType === HTMLElement | SVGElement);
export const isVideo = unknown => isYoutube(unknown) || isVimeo(unknown) || isHTML5(unknown);
export const isHTML5 = unknown => isNode(unknown) && unknown.tagName === 'VIDEO';
export const isIFrame = unknown => isNode(unknown) && unknown.tagName === 'IFRAME';
export const isYoutube = unknown => isIFrame(unknown) && !!unknown.src.match(/\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/);
export const isVimeo = unknown => isIFrame(unknown) && !!unknown.src.match(/vimeo\.com\/video\/.*/);

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
intia-theme-0.1.65 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.64 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.63 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.62 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.61 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.60 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.59 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.58 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.57 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.56 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.55 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.54 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.53 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.52 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.51 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.50 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.49 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.48 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.47 node_modules/bulma-carousel/src/js/utils/type.js
intia-theme-0.1.46 node_modules/bulma-carousel/src/js/utils/type.js