UNPKG

812 BJavaScriptView Raw
1/*eslint no-nested-ternary:0*/
2
3class TokenType {
4 constructor(options) {
5 options = options || {};
6 this.private = options.private || false;
7 this.nonVerb = options.nonVerb || false;
8 this.len = options.len || [1, Number.MAX_SAFE_INTEGER];
9 this.arrayVerb = options.arrayVerb || false;
10 this.collectionVerb = options.collectionVerb || false;
11 this.chainIndex = options.chainIndex || null;
12 this.nonChained = options.nonChained || this.nonVerb || false;
13 this.recursive = options.recursive || false;
14 this.tryToHoist = options.tryToHoist || this.collectionVerb;
15 this.stable = options.stable || false;
16 this.expectedTypes =
17 options.expectedTypes ||
18 (this.arrayVerb ? ['array'] :
19 this.collectionVerb ? ['object'] : null)
20 }
21}
22
23module.exports = TokenType;