const T = {
	isNull(v) {
		return v === null || v === undefined
	},

	/**
	 * compose component's severity
	 * @param props
	 * @param keys
	 * @param mapping
	 * @returns {string}
	 */
	composeSeverity(props, keys, mapping) {
		for (const key of keys) {
			if (typeof props[key] === "string" || (typeof props[key] === "boolean" && props[key])) {
				if (typeof mapping[key] === "string") {
					return mapping[key]
				}

				return key
			}
		}

		if (typeof props.severity === "string" && props.severity.length > 0)  {
			if (typeof mapping[props.severity] === "string") {
				return mapping[props.severity]
			}
			return props.severity
		}
	}
}

export default T