(u: unknown)
| 3952 | SchemaGetter.transformOrFail((sym: symbol, options) => { |
| 3953 | const key = globalThis.Symbol.keyFor(sym) |
| 3954 | if (key !== undefined) { |
| 3955 | return Effect.succeed(globalThis.String(sym)) |
| 3956 | } |
| 3957 | return Effect.fail( |
| 3958 | new SchemaIssue.Forbidden( |
| 3959 | { message: "cannot serialize to string, Symbol is not registered" }, |
| 3960 | sym, |
| 3961 | options |
| 3962 | ) |
| 3963 | ) |
| 3964 | }) |
| 3965 | ) |
| 3966 | ) |
| 3967 | |
| 3968 | /** @internal */ |
| 3969 | export function isStringSymbol(annotations?: Schema.Annotations.Filter) { |
| 3970 | return isPattern( |
| 3971 | isStringSymbolRegExp, |
| 3972 | { |
| 3973 | expected: "a string representing a symbol", |
| 3974 | representation: { |
| 3975 | id: "effect/schema/isStringSymbol", |
| 3976 | payload: null |
| 3977 | }, |
no test coverage detected
searching dependent graphs…