/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/schema/src/session-id.ts
15 строк
473 B
Kit Langton
refactor(schema): normalize module patterns (#33770)
25 июн 2026, 18:42
Не верифицирован
25 июн 2026, 18:42
7854f5b
Код
Авторство
О чём код?
import { Schema } from "effect" import { descending } from "./identifier" import { statics } from "./schema" export const SessionID = Schema.String.check(Schema.isStartsWith("ses")).pipe( Schema.brand("SessionID"), statics((schema) => { const create = () => schema.make("ses_" + descending()) return { create, descending: (id?: string) => (id === undefined ? create() : schema.make(id)), } }), ) export type SessionID = typeof SessionID.Type