{
  "version": 3,
  "sources": ["../../../../../src/libs/custom/data-structure/common/option.mts"],
  "sourcesContent": ["import type { Func } from \"../../../../types/concepts.mjs\";\n\nexport interface Option<T> {\n  value?: T;\n}\n\nexport interface None {}\n\nexport interface Some<T> {\n  value: T;\n}\n\nexport const some = <T extends unknown>(value: T): Some<T> => ({ value });\nexport const none = (): None => ({});\n\nexport const hasSome = <T extends unknown>(\n  option: Option<T>\n): option is Some<T> => Reflect.has(option, \"value\");\n\nexport const hasNone = <T extends unknown>(option: Option<T>): option is None =>\n  !Reflect.has(option, \"value\");\n\nexport const match = <T, R>(\n  option: Option<T>,\n  whenSome: Func<[value: T], R>,\n  whenNone: Func<[], R>\n) => (hasSome(option) ? whenSome(option.value) : whenNone());\n"],
  "mappings": "AAYO,MAAM,OAAO,CAAoB,UAAuB,GAAE;AAC1D,MAAM,OAAO,MAAa;AAE1B,MAAM,UAAU,CACrB,WACsB,QAAQ,IAAI,QAAQ;AAErC,MAAM,UAAU,CAAoB,WACzC,CAAC,QAAQ,IAAI,QAAQ;AAEhB,MAAM,QAAQ,CACnB,QACA,UACA,aACI,QAAQ,UAAU,SAAS,OAAO,SAAS;",
  "names": []
}
