Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// tslint:disable-next-line:no-null-keyword
const result = Object.create(null);
const scopes = Object.keys(tokenTypes);
const len = scopes.length;
for (let i = 0; i < len; i++) {
const scope = scopes[i];
const tokenType = tokenTypes[scope];
switch (tokenType) {
case 'string':
result[scope] = StandardTokenType.String;
break;
case 'other':
result[scope] = StandardTokenType.Other;
break;
case 'comment':
result[scope] = StandardTokenType.Comment;
break;
}
}
return result;
}