|
|
@@ -91,9 +91,9 @@ function p5Utils__promisify(fun) {
|
|
|
// Object.prototype.toString.call({}) // "[object Object]"
|
|
|
// Object.prototype.toString.call(null) // "[object Null]"
|
|
|
// Object.prototype.toString.call() // "[object Undefined]"
|
|
|
-function p5Utils__isString(arg) { return '[object String]' === Object.prototype.toString.call(arg); }
|
|
|
-function p5Utils__isArray(arg) { return '[object Array]' === Object.prototype.toString.call(arg); }
|
|
|
-function p5Utils__isObject(arg) { return '[object Object]' === Object.prototype.toString.call(arg); }
|
|
|
+function p5Utils__isString(arg) { return ('string' === typeof arg); }// '[object String]' === Object.prototype.toString.call(arg); }
|
|
|
+function p5Utils__isArray(arg) { return (Array.isArray) ? Array.isArray(arg) : '[object Array]' === Object.prototype.toString.call(arg); }
|
|
|
+function p5Utils__isObject(arg) { return ('object' === typeof arg && null !== arg && 'function' === typeof arg.constructor && !p5Utils__isArray(arg)); } // '[object Object]' === Object.prototype.toString.call(arg); }
|
|
|
|
|
|
global.p5Utils__format = p5Utils__format
|
|
|
global.p5Utils__parseFloatOrZero = p5Utils__parseFloatOrZero
|