MCPcopy Create free account
hub / github.com/Effect-TS/effect / parse

Function parse

packages/effect/src/unstable/persistence/Persistence.ts:890–904  ·  view source on GitHub ↗
(str: string | null)

Source from the content-addressed store, hash-verified

888 Effect.sync(() => {
889 const prefixed = (key: string) => `${prefix}:${key}`
890 const parse = (str: string | null) => {
891 if (str === null) {
892 return Effect.undefined
893 }
894 try {
895 return Effect.succeed(JSON.parse(str))
896 } catch (cause) {
897 return Effect.fail(
898 new PersistenceError({
899 message: `Failed to parse value from Redis`,
900 cause
901 })
902 )
903 }
904 }
905 return identity<BackingPersistenceStore>({
906 get: (key) =>
907 Effect.flatMap(

Callers

nothing calls this directly

Calls 3

succeedMethod · 0.45
parseMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected