Skip to main content
import * as License from 'voltaire-effect/License'
import * as Schema from 'effect/Schema'
import { Effect } from 'effect'

// Schema
const mit = Schema.decodeSync(License.String)('MIT')
Schema.decodeSync(License.String)('Apache-2.0')
Schema.decodeSync(License.String)('GPL-3.0')

// Effect constructor
const license = Effect.runSync(License.from('MIT'))

Error Handling

const result = Effect.runSync(Effect.either(License.from('')))
// Left(LicenseError)