
import kindOf from 'kind-of';
import isObject from 'isobject';
import isPlainObject from 'is-plain-object';

const MAX_ARRAY_INDEX = ( 2 ** 53 ) - 1;
const isDefined = v => v !== null && v !== undefined;
const isUndefined = v => v === null || v === undefined;

// https://github.com/jonschlinkert/kind-of
export { kindOf };

export function property( key ) {
  return function ( obj ) {
    return isUndefined( obj ) ? undefined : obj[key];
  };
}

export function instanceOf( Cls ) {
  return function ( obj ) {
    return ( obj instanceof Cls );
  };
}

// Number, Function, RegExp, Boolean, Date, Error, Arguments,
// PlainObject, Object, Array, ArrayLike, Element
const is = {
  Undefined: isUndefined,
  Defined: isDefined,
  Element: v => !!( v && v.nodeType === 1 ),
  PlainObject: isPlainObject,
  Object: isObject
};


[ 'Array', 'Number', 'Function', 'RegExp', 'Boolean', 'Date', 'Error',
  'Arguments', 'Null', 'String' ].forEach( name => {
    is[name] = v => kindOf( v ) === name.toLowerCase();
  });


const getLength = property( 'length' );
is.ArrayLike = function ( collection ) {
  const length = getLength( collection );
  return is.Number( length ) && length >= 0 && length <= MAX_ARRAY_INDEX;
};

export default is;

@@ -339,142 +339,17 @@
 ion 
-property( key ) %7B%0A  return function ( obj ) %7B%0A    return isUndefined( obj ) ? undefined : obj%5Bkey%5D;%0A  %7D;%0A%7D%0A%0Aexport function instanceOf
+itIsClass
 ( Cl
@@ -371,17 +371,16 @@
 function
- 
 ( obj ) 
@@ -542,16 +542,18 @@
 t%0Aconst 
+it
 is = %7B%0A 
@@ -826,16 +826,18 @@
 %3E %7B%0A    
+it
 is%5Bname%5D
@@ -910,30 +910,86 @@
 h = 
-property( 'length' );%0A
+function( obj ) %7B%0A  return itis.Object( obj ) ? obj.length : undefined;%0A%7D;%0A%0Ait
 is.A
@@ -1007,17 +1007,16 @@
 function
- 
 ( collec
@@ -1075,16 +1075,18 @@
  return 
+it
 is.Numbe
@@ -1161,12 +1161,14 @@
 default 
+it
 is;%0A

rename itis itIsClass