@effect/match
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -53,2 +53,3 @@ /** | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -61,2 +62,3 @@ export declare const type: <I>() => Matcher<I, I, I, never, never>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -68,2 +70,3 @@ export declare const value: <I>(i: I) => Matcher<I, I, I, never, I>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -78,2 +81,3 @@ export declare const when: { | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -93,2 +97,3 @@ export declare const tag: { | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -123,6 +128,6 @@ export declare const not: { | ||
* refinements that could make the pattern not match. | ||
* | ||
* @category predicates | ||
* @tsplus static effect/match/Matcher.Ops unsafe | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -133,6 +138,6 @@ export declare const unsafe: <A>(schema: S.Schema<A>) => SafeSchema<A, never>; | ||
* contain refinements that could make the pattern not match. | ||
* | ||
* @category predicates | ||
* @tsplus static effect/match/Matcher.Ops safe | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -144,2 +149,3 @@ export declare const safe: <A, R = A>(schema: S.Schema<A>) => SafeSchema<A, R>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -151,2 +157,3 @@ export declare const is: <Literals extends readonly AST.LiteralValue[]>(...a: Literals) => SafeSchema<Literals[number], Literals[number]>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -158,2 +165,3 @@ export declare const string: SafeSchema<string, string>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -165,2 +173,3 @@ export declare const number: SafeSchema<number, number>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -172,2 +181,3 @@ export declare const any: SafeSchema<unknown, any>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -178,2 +188,3 @@ export declare const boolean: SafeSchema<boolean, boolean>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -190,2 +201,3 @@ export declare const _undefined: SafeSchema<undefined, undefined>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -203,2 +215,3 @@ export declare const _null: SafeSchema<null, null>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -210,2 +223,3 @@ export declare const bigint: SafeSchema<bigint, bigint>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -217,2 +231,3 @@ export declare const date: SafeSchema<Date, Date>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -222,4 +237,5 @@ export declare const orElse: <RA, B>(f: (b: RA) => B) => <I, R, A, Pr>(self: Matcher<I, R, RA, A, Pr>) => [Pr] extends [never] ? (input: I) => B | A : B | A; | ||
* @category conversions | ||
* @tsplus pipeable effect/match/Matcher either | ||
* @tsplus getter effect/match/Matcher either | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -229,4 +245,5 @@ export declare const either: <I, R, RA, A, Pr>(self: Matcher<I, R, RA, A, Pr>) => [Pr] extends [never] ? (input: I) => E.Either<RA, A> : E.Either<RA, A>; | ||
* @category conversions | ||
* @tsplus pipeable effect/match/Matcher option | ||
* @tsplus getter effect/match/Matcher option | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -238,2 +255,3 @@ export declare const option: <I, R, RA, A, Pr>(self: Matcher<I, R, RA, A, Pr>) => [Pr] extends [never] ? (input: I) => O.Option<A> : O.Option<A>; | ||
* @since 1.0.0 | ||
* @tsplus location "@effect/match" | ||
*/ | ||
@@ -240,0 +258,0 @@ export declare const exhaustive: <I, R, A, Pr>(self: Matcher<I, R, never, A, Pr>) => [Pr] extends [never] ? (u: I) => A : A; |
42
index.js
@@ -140,3 +140,4 @@ "use strict"; | ||
exports.unsafe = unsafe; | ||
const safe = schema => schema; | ||
const safe_1 = schema => schema; | ||
const safe = safe_1; | ||
/** | ||
@@ -148,3 +149,3 @@ * @category predicates | ||
exports.safe = safe; | ||
const is = /*#__PURE__*/(0, _Function.flow)(S.literal, safe); | ||
const is = /*#__PURE__*/(0, _Function.flow)(S.literal, safe_1); | ||
/** | ||
@@ -156,3 +157,3 @@ * @category predicates | ||
exports.is = is; | ||
const string = /*#__PURE__*/safe(S.string); | ||
const string = /*#__PURE__*/safe_1(S.string); | ||
/** | ||
@@ -164,3 +165,3 @@ * @category predicates | ||
exports.string = string; | ||
const number = /*#__PURE__*/safe(S.number); | ||
const number = /*#__PURE__*/safe_1(S.number); | ||
/** | ||
@@ -172,3 +173,3 @@ * @category predicates | ||
exports.number = number; | ||
const any = /*#__PURE__*/safe(S.any); | ||
const any = /*#__PURE__*/safe_1(S.any); | ||
/** | ||
@@ -180,3 +181,3 @@ * @category predicates | ||
exports.any = any; | ||
const boolean = /*#__PURE__*/safe(S.boolean); | ||
const boolean = /*#__PURE__*/safe_1(S.boolean); | ||
/** | ||
@@ -187,4 +188,6 @@ * @tsplus static effect/match/Matcher.Ops undefined | ||
exports.boolean = boolean; | ||
const _undefined = /*#__PURE__*/safe(S.undefined); | ||
exports.undefined = exports._undefined = _undefined; | ||
const _undefined_1 = /*#__PURE__*/safe_1(S.undefined); | ||
exports.undefined = _undefined_1; | ||
const _undefined = _undefined_1; | ||
exports._undefined = _undefined; | ||
/** | ||
@@ -194,4 +197,6 @@ * @tsplus static effect/match/Matcher.Ops null | ||
*/ | ||
const _null = /*#__PURE__*/safe(S.null); | ||
exports.null = exports._null = _null; | ||
const _null_1 = /*#__PURE__*/safe_1(S.null); | ||
exports.null = _null_1; | ||
const _null = _null_1; | ||
exports._null = _null; | ||
/** | ||
@@ -202,3 +207,3 @@ * @category predicates | ||
*/ | ||
const bigint = /*#__PURE__*/safe(S.bigint); | ||
const bigint = /*#__PURE__*/safe_1(S.bigint); | ||
/** | ||
@@ -210,3 +215,3 @@ * @category predicates | ||
exports.bigint = bigint; | ||
const date = /*#__PURE__*/safe(S.date); | ||
const date = /*#__PURE__*/safe_1(S.date); | ||
/** | ||
@@ -219,3 +224,3 @@ * @category conversions | ||
const orElse = f => self => { | ||
const result = either(self); | ||
const result = either_1(self); | ||
if (E.isEither(result)) { | ||
@@ -233,7 +238,7 @@ // @ts-expect-error | ||
* @category conversions | ||
* @tsplus pipeable effect/match/Matcher either | ||
* @tsplus getter effect/match/Matcher either | ||
* @since 1.0.0 | ||
*/ | ||
exports.orElse = orElse; | ||
const either = self => { | ||
const either_1 = self => { | ||
if (self._tag === "ValueMatcher") { | ||
@@ -257,5 +262,6 @@ return self.value; | ||
}; | ||
const either = either_1; | ||
/** | ||
* @category conversions | ||
* @tsplus pipeable effect/match/Matcher option | ||
* @tsplus getter effect/match/Matcher option | ||
* @since 1.0.0 | ||
@@ -265,3 +271,3 @@ */ | ||
const option = self => { | ||
const toEither = either(self); | ||
const toEither = either_1(self); | ||
if (E.isEither(toEither)) { | ||
@@ -279,3 +285,3 @@ return O.fromEither(toEither); | ||
const exhaustive = self => { | ||
const toEither = either(self); | ||
const toEither = either_1(self); | ||
if (E.isEither(toEither)) { | ||
@@ -282,0 +288,0 @@ if (toEither._tag === "Right") { |
{ | ||
"name": "@effect/match", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55128
846