>>,
Types.ApplyFilters<
I,
Types.AddWithout>>
>,
A | ReturnType,
Pr
> = internal.tags
/**
* @category combinators
* @since 1.0.0
*/
export const tagsExhaustive: <
R,
P extends {
readonly [Tag in Types.Tags<"_tag", R> & string]: (
_: Extract>,
) => any
},
>(
fields: P,
) => (
self: Matcher,
) => [Pr] extends [never] ? (u: I) => Unify>
: Unify> = internal.tagsExhaustive
/**
* @category combinators
* @since 1.0.0
*/
export const not: <
R,
const P extends Types.PatternPrimitive | Types.PatternBase,
Fn extends (_: Types.NotMatch) => unknown,
>(
pattern: P,
f: Fn,
) => (
self: Matcher,
) => Matcher<
I,
Types.AddOnly>,
Types.ApplyFilters>>,
A | ReturnType,
Pr
> = internal.not as any
/**
* @category predicates
* @since 1.0.0
*/
export const nonEmptyString: SafeRefinement =
internal.nonEmptyString
/**
* @category predicates
* @since 1.0.0
*/
export const is: <
Literals extends ReadonlyArray,
>(...literals: Literals) => Predicate.Refinement =
internal.is
/**
* @category predicates
* @since 1.0.0
*/
export const string: Predicate.Refinement = Predicate.isString
/**
* @category predicates
* @since 1.0.0
*/
export const number: Predicate.Refinement = Predicate.isNumber
/**
* @category predicates
* @since 1.0.0
*/
export const any: SafeRefinement = internal.any
/**
* @category predicates
* @since 1.0.0
*/
export const defined: (u: A) => u is A & {} = internal.defined
/**
* @category predicates
* @since 1.0.0
*/
export const boolean: Predicate.Refinement =
Predicate.isBoolean
const _undefined: Predicate.Refinement =
Predicate.isUndefined
export {
/**
* @category predicates
* @since 1.0.0
*/
_undefined as undefined,
}
const _null: Predicate.Refinement = Predicate.isNull
export {
/**
* @category predicates
* @since 1.0.0
*/
_null as null,
}
/**
* @category predicates
* @since 1.0.0
*/
export const bigint: Predicate.Refinement = Predicate.isBigint
/**
* @category predicates
* @since 1.0.0
*/
export const date: Predicate.Refinement = Predicate.isDate
/**
* @category predicates
* @since 1.0.0
*/
export const record: Predicate.Refinement<
unknown,
{
[k: string]: any
[k: symbol]: any
}
> = Predicate.isRecord
/**
* @category predicates
* @since 1.0.0
*/
export const instanceOf: any>(
constructor: A,
) => SafeRefinement, never> = internal.instanceOf
/**
* @category predicates
* @since 1.0.0
*/
export const instanceOfUnsafe: any>(
constructor: A,
) => SafeRefinement, InstanceType> = internal.instanceOf
/**
* @category conversions
* @since 1.0.0
*/
export const orElse: (
f: (b: RA) => B,
) => (
self: Matcher,
) => [Pr] extends [never] ? (input: I) => Unify : Unify =
internal.orElse
/**
* @category conversions
* @since 1.0.0
*/
export const orElseAbsurd: (
self: Matcher,
) => [Pr] extends [never] ? (input: I) => Unify : Unify =
internal.orElseAbsurd
/**
* @category conversions
* @since 1.0.0
*/
export const either: (
self: Matcher,
) => [Pr] extends [never] ? (input: I) => E.Either>
: E.Either> = internal.either
/**
* @category conversions
* @since 1.0.0
*/
export const option: (
self: Matcher,
) => [Pr] extends [never] ? (input: I) => O.Option>
: O.Option> = internal.option
/**
* @category conversions
* @since 1.0.0
*/
export const exhaustive: (
self: Matcher,
) => [Pr] extends [never] ? (u: I) => Unify : Unify = internal.exhaustive