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 01a96e8 commit 967e724Copy full SHA for 967e724
src/types.js
@@ -1,12 +1,10 @@
1
module.exports = function enforce(type, value) {
2
switch (type) {
3
- // http://jsperf.com/array-typecheck-2
4
case 'Array': {
5
if (Array.isArray(value)) return
6
break
7
}
8
9
- // http://jsperf.com/boolean-typecheck
10
case 'Boolean': {
11
if (typeof value === 'boolean') return
12
@@ -17,13 +15,11 @@ module.exports = function enforce(type, value) {
17
15
18
16
19
20
- // http://jsperf.com/number-constructor-v-isnan
21
case 'Number': {
22
if (typeof value === 'number') return
23
24
25
26
- // http://jsperf.com/string-typecheck-2
27
case 'String': {
28
if (typeof value === 'string') return
29
0 commit comments