class types { static check_string(target, none = false) { if (none && (target === undefined || target === null)) { return; } if (typeof(target) !== "string") { throw new TypeError("Target must be string."); } } static check_number(target, none = false) { if (none && (target === undefined || target === null)) { return; } if (typeof(target) !== "number") { throw new TypeError("Target must be number."); } } static check_html_element(target, none = false) { if (none && (target === undefined || target === null)) { return; } if (target instanceof HTMLElement) { return; } throw new TypeError("Target must be an HTML Element."); } static check_callback(target, none = false) { if (none && (target === undefined || target === null)) { return; } if (typeof(target) !== "function") { throw new TypeError("Target must be an callback."); } } static check_boolean(target, none = false) { if (none && (target === undefined || target === null)) { return; } if (typeof(target) !== "boolean") { throw new TypeError("Target must be an boolean."); } } static block_strings(target, blocked) { for (const string in blocked) { if (target.search(string) !== -1) { const fail = "Target can not contain \"" + string + "\"."; throw new TypeError(fail); } } } } export { types };