()
| 54 | }; |
| 55 | |
| 56 | const loadEntry = (): Effect.Effect<EntryConstructor, KeychainError> => |
| 57 | isSupportedPlatform() |
| 58 | ? Effect.tryPromise({ |
| 59 | try: async () => { |
| 60 | entryCtorPromise ??= loadEntryCtor(); |
| 61 | return await entryCtorPromise; |
| 62 | }, |
| 63 | catch: (cause) => |
| 64 | new KeychainError({ |
| 65 | message: "Failed loading native keyring", |
| 66 | cause, |
| 67 | }), |
| 68 | }) |
| 69 | : Effect.fail( |
| 70 | new KeychainError({ |
| 71 | message: `Failed loading native keyring: unsupported platform '${process.platform}'`, |
| 72 | }), |
| 73 | ); |
| 74 | |
| 75 | const createEntry = (serviceName: string, account: string) => |
| 76 | Effect.flatMap(loadEntry(), (Entry) => |
no test coverage detected