We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c380a0 commit 01a96e8Copy full SHA for 01a96e8
src/types.js
@@ -2,7 +2,7 @@ module.exports = function enforce(type, value) {
2
switch (type) {
3
// http://jsperf.com/array-typecheck-2
4
case 'Array': {
5
- if (value != null && value.constructor === Array) return
+ if (Array.isArray(value)) return
6
break
7
}
8
@@ -25,7 +25,7 @@ module.exports = function enforce(type, value) {
25
26
// http://jsperf.com/string-typecheck-2
27
case 'String': {
28
- if (value != null && value.constructor === String) return
+ if (typeof value === 'string') return
29
30
31
0 commit comments