chore: couple more inferences
This commit is contained in:
parent
1bdbf8a0b4
commit
7d7f39961a
|
@ -117,8 +117,26 @@ export default class Context {
|
||||||
return 'undefined';
|
return 'undefined';
|
||||||
default:
|
default:
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
|
if (
|
||||||
|
2 === value.length
|
||||||
|
&& !Number.isNaN(parseInt(value[0], 10))
|
||||||
|
&& !Number.isNaN(parseInt(value[1], 10))
|
||||||
|
) {
|
||||||
|
return 'vector';
|
||||||
|
}
|
||||||
return 'array';
|
return 'array';
|
||||||
}
|
}
|
||||||
|
if ('undefined' !== typeof value.type) {
|
||||||
|
const types = [
|
||||||
|
'expressions',
|
||||||
|
'expression',
|
||||||
|
'invocation',
|
||||||
|
'literal',
|
||||||
|
];
|
||||||
|
if (-1 !== types.indexOf(value.type)) {
|
||||||
|
return value.type;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 'object';
|
return 'object';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user