diff src/sceditor.js @ 27:8165b83907af

remove bind()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 10 Aug 2022 23:48:47 -0600
parents 80bf0adc9efd
children f227fdfebded
line wrap: on
line diff
--- a/src/sceditor.js	Tue Aug 09 23:30:24 2022 -0600
+++ b/src/sceditor.js	Wed Aug 10 23:48:47 2022 -0600
@@ -11,29 +11,31 @@
 	 * @param {*} arg
 	 * @returns {boolean}
 	 */
-	function isTypeof(type, arg) {
-		return typeof arg === type;
+	function isTypeof(type) {
+		return function(arg) {
+			return typeof arg === type;
+		};
 	}
 
 	/**
 	 * @type {function(*): boolean}
 	 */
-	var isString = isTypeof.bind(null, 'string');
+	var isString = isTypeof('string');
 
 	/**
 	 * @type {function(*): boolean}
 	 */
-	var isUndefined = isTypeof.bind(null, 'undefined');
+	var isUndefined = isTypeof('undefined');
 
 	/**
 	 * @type {function(*): boolean}
 	 */
-	var isFunction = isTypeof.bind(null, 'function');
+	var isFunction = isTypeof('function');
 
 	/**
 	 * @type {function(*): boolean}
 	 */
-	var isNumber = isTypeof.bind(null, 'number');
+	var isNumber = isTypeof('number');
 
 
 	/**
@@ -2464,7 +2466,7 @@
 				}
 
 				onEvent(content, 'click', '.button', insertUrl);
-				onEvent(content, 'keypress', function (target, e) {
+				onEvent(content, 'keypress', function (e) {
 					// 13 = enter key
 					if (e.which === 13 && linkInput.value) {
 						insertUrl(e);