UNPKG
npm-couple
Version:
latest (1.0.4)
1.0.4
1.0.3
1.0.1
A library to couple two objects.
www.github.com/ryansmith94/couple
ryansmith94/couple
npm-couple
/
src
/
type.coffee
14 lines
(12 loc)
•
370 B
text/coffeescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
define =
this
.
define
||
require
(
'amdefine'
)(
module
)
define
([], () ->
type
= (value) -> valueType =
typeof
value
switch
valueType when
'object'
switch
value.
constructor
when
Array
then
'array'
when
RegExp
then
'regexp'
else
'object'
else
valueType )