mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
Updated EditorConfig Recommendations
Applied 4-spaces for everything as per: https://locomotivemtl.teamwork.com/tasks/7113032
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
var toString = Object.prototype.toString,
|
||||
arrayLikePattern = /^\[object (?:Array|FileList)\]$/;
|
||||
arrayLikePattern = /^\[object (?:Array|FileList)\]$/;
|
||||
|
||||
// thanks, http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/
|
||||
export function isArray ( thing ) {
|
||||
return toString.call( thing ) === '[object Array]';
|
||||
return toString.call( thing ) === '[object Array]';
|
||||
}
|
||||
|
||||
export function isArrayLike ( obj ) {
|
||||
return arrayLikePattern.test( toString.call( obj ) );
|
||||
return arrayLikePattern.test( toString.call( obj ) );
|
||||
}
|
||||
|
||||
export function isEqual ( a, b ) {
|
||||
if ( a === null && b === null ) {
|
||||
return true;
|
||||
}
|
||||
if ( a === null && b === null ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( typeof a === 'object' || typeof b === 'object' ) {
|
||||
return false;
|
||||
}
|
||||
if ( typeof a === 'object' || typeof b === 'object' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return a === b;
|
||||
return a === b;
|
||||
}
|
||||
|
||||
// http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric
|
||||
export function isNumeric ( thing ) {
|
||||
return !isNaN( parseFloat( thing ) ) && isFinite( thing );
|
||||
return !isNaN( parseFloat( thing ) ) && isFinite( thing );
|
||||
}
|
||||
|
||||
export function isObject ( thing ) {
|
||||
return ( thing && toString.call( thing ) === '[object Object]' );
|
||||
return ( thing && toString.call( thing ) === '[object Object]' );
|
||||
}
|
||||
|
||||
export function isFunction( thing ) {
|
||||
var getType = {};
|
||||
return thing && getType.toString.call(thing) === '[object Function]';
|
||||
var getType = {};
|
||||
return thing && getType.toString.call(thing) === '[object Function]';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user