import { Just, JUST } from './Just' import { Maybe } from './Maybe' /** * Given a Maybe it returns true if the Maybe is Just or * false if it is a Nothing. * @name isJust(maybe: Maybe): maybe is Just * @example * import { isJust, Nothing, Maybe } from '@typed/maybe' * * console.log(isJust(Nothing)) // logs false * console.log(isJust(Maybe.of(1))) // logs true */ export function isJust(maybe: Maybe): maybe is Just { return maybe.hasOwnProperty(JUST) }