|
@@ -21,6 +21,11 @@ const assetType = (value, type) => { |
|
@@ -21,6 +21,11 @@ const assetType = (value, type) => { |
21
|
if (!valid && t === 'object') {
|
21
|
if (!valid && t === 'object') {
|
22
|
valid = value instanceof type;
|
22
|
valid = value instanceof type;
|
23
|
}
|
23
|
}
|
|
|
24
|
+ if (!valid && expectedType.toLowerCase() === 'number') {
|
|
|
25
|
+ const parseNumber = parseInt(value, 10);
|
|
|
26
|
+
|
|
|
27
|
+ valid = parseNumber || parseNumber === 0;
|
|
|
28
|
+ }
|
24
|
} else if (expectedType === 'Object') {
|
29
|
} else if (expectedType === 'Object') {
|
25
|
valid = value.toString() === '[object Object]';
|
30
|
valid = value.toString() === '[object Object]';
|
26
|
} else if (expectedType === 'Array') {
|
31
|
} else if (expectedType === 'Array') {
|