| 103 | CryptoProxy.setEndpoint(new CryptoApi(), (endpoint) => endpoint.clearKeyStore()); |
| 104 | return new OpenPGPCryptoWithCryptoProxy(CryptoProxy); |
| 105 | } |
| 106 | |
| 107 | class FeatureFlagProvider { |
| 108 | constructor(private flags: Record<FeatureFlags, boolean>) { |
| 109 | this.flags = flags; |
| 110 | } |
| 111 | |
| 112 | static async fromJsonFile(jsonFile: string) { |
| 113 | const file = Bun.file(jsonFile); |
| 114 | |
| 115 | if (!(await file.exists())) { |
| 116 | return new FeatureFlagProvider({} as Record<FeatureFlags, boolean>); |
| 117 | } |
| 118 | |
| 119 | const bytes = await file.bytes(); |