| 717 | export class ContextKeyLessOrEqualsExpr implements IContextKeyExpression { |
| 718 | |
| 719 | public static create(key: string, value: any): ContextKeyExpression { |
| 720 | if (typeof value === 'boolean') { |
| 721 | return (value ? ContextKeyDefinedExpr.create(key) : ContextKeyNotExpr.create(key)); |
| 722 | } |
| 723 | const staticValue = STATIC_VALUES.get(key); |
| 724 | if (typeof staticValue === 'boolean') { |
| 725 | const trueValue = staticValue ? 'true' : 'false'; |
| 726 | return (value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE); |
| 727 | } |
| 728 | return new ContextKeyLessOrEqualsExpr(key, value); |
| 729 | } |
| 730 | |
| 731 | public readonly type = ContextKeyExprType.LessOrEquals; |
| 732 | |