| 374 | export class ContextKeyEqualsExpr implements IContextKeyExpression { |
| 375 | |
| 376 | public static create(key: string, value: any): ContextKeyExpression { |
| 377 | if (typeof value === 'boolean') { |
| 378 | return (value ? ContextKeyDefinedExpr.create(key) : ContextKeyNotExpr.create(key)); |
| 379 | } |
| 380 | const staticValue = STATIC_VALUES.get(key); |
| 381 | if (typeof staticValue === 'boolean') { |
| 382 | const trueValue = staticValue ? 'true' : 'false'; |
| 383 | return (value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE); |
| 384 | } |
| 385 | return new ContextKeyEqualsExpr(key, value); |
| 386 | } |
| 387 | |
| 388 | public readonly type = ContextKeyExprType.Equals; |
| 389 | |