Skip to content

Commit 755d3d6

Browse files
committed
Fix error in toType and method and make compatible with module.exports
1 parent e1f6e7e commit 755d3d6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

source/quo.coffee

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ Quo = do ->
7373
target[key] = source[key] for key of source
7474
target
7575

76-
$$.toType = (obj) -> $$.toType = (obj) ->
77-
match = OBJECT_PROTOTYPE.toString.call(obj).match(/\s([a-z|A-Z])/)
78-
if match then match[1].toLowerCase() else 'object'
76+
$$.toType = (obj) ->
77+
match = OBJECT_PROTOTYPE.toString.call(obj).match(/\s([a-z|A-Z]+)/)
78+
if match.length > 1 then match[1].toLowerCase() else "object"
7979

8080
$$.each = (elements, callback) ->
8181
i = undefined
@@ -184,8 +184,10 @@ Quo = do ->
184184

185185
$$.fn.indexOf = EMPTY_ARRAY.indexOf
186186

187-
$$.version = "3.0.6"
187+
$$.version = "3.0.7"
188188

189189
$$
190190

191191
@Quo = @$$ = Quo
192+
193+
module?.exports = Quo

0 commit comments

Comments
 (0)