var kindOf = require('../lang/kindOf')

function makeCollectionMethod (arr, obj, str, rex, def) {
  return function (list) {
    // this will be an excellent use of the spread operator.
    // args = slice(arguments, 1)
    var test = kindOf(list)
    if (test === 'array')  return arr.apply(null, arguments)
    if (test === 'object') return obj.apply(null, arguments)
    if (test === 'string') return str.apply(null, arguments)
    if (test === 'regexp') return rex.apply(null, arguments)
    if (test == null) return def
  }
}

module.exports = makeCollectionMethod

@@ -1,18 +1,21 @@
 var 
-kindOf
+isInteger
  = requi
@@ -26,22 +26,25 @@
 ../lang/
-kindOf
+isInteger
 ')%0A%0Afunc
@@ -196,62 +196,40 @@
  // 
-args = slice(arguments, 1)%0A    var test = kindOf(list)
+will be able to get rid of apply
 %0A   
@@ -237,60 +237,42 @@
 if (
-te
+li
 st ==
-= 'array')  return arr.apply(null, arguments)
+ null) return defaultReturn
 %0A   
@@ -277,25 +277,32 @@
    if (t
-e
+ypeof li
 st === '
 object')
@@ -297,14 +297,14 @@
 == '
-object
+string
 ') r
@@ -309,19 +309,19 @@
  return 
-obj
+str
 .apply(n
@@ -348,25 +348,30 @@
 if (
-test === 'string'
+list instanceof RegExp
 ) re
@@ -367,35 +367,35 @@
  RegExp) return 
-str
+rex
 .apply(null, arg
@@ -406,101 +406,114 @@
 ts)%0A
+%0A
     
-if (test === 'regexp') return rex.apply(null, arguments)%0A    if (test == null) return def
+return (isInteger(list.length))%0A      ? arr.apply(null, arguments)%0A      : obj.apply(null, arguments)
 %0A  %7D

update collection/_make