@duplojs/utils 1.0.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array/coalescing.cjs +9 -0
- package/dist/array/coalescing.d.ts +3 -0
- package/dist/array/coalescing.mjs +7 -0
- package/dist/array/index.cjs +2 -0
- package/dist/array/index.d.ts +1 -0
- package/dist/array/index.mjs +1 -0
- package/dist/array/map.cjs +1 -1
- package/dist/array/map.d.ts +2 -2
- package/dist/array/map.mjs +1 -1
- package/dist/array/reduce.cjs +1 -1
- package/dist/array/reduce.mjs +1 -1
- package/dist/array/types/ArrayCoalescing.d.ts +1 -0
- package/dist/array/types/index.d.ts +1 -0
- package/dist/common/escapeRegExp.cjs +2 -2
- package/dist/common/escapeRegExp.d.ts +1 -1
- package/dist/common/escapeRegExp.mjs +2 -2
- package/dist/common/index.d.ts +2 -0
- package/dist/common/instanceOf.cjs +20 -0
- package/dist/common/instanceOf.d.ts +3 -0
- package/dist/common/instanceOf.mjs +18 -0
- package/dist/common/kind.cjs +45 -1
- package/dist/common/kind.d.ts +24 -4
- package/dist/common/kind.mjs +44 -2
- package/dist/common/memo.cjs +16 -0
- package/dist/common/memo.d.ts +5 -0
- package/dist/common/memo.mjs +14 -0
- package/dist/common/simpleClone.cjs +2 -2
- package/dist/common/simpleClone.mjs +2 -2
- package/dist/common/types/anyConstructor.d.ts +1 -0
- package/dist/common/types/anyPredicate.d.ts +1 -0
- package/dist/common/types/index.d.ts +2 -0
- package/dist/common/types/objectEntry.d.ts +1 -1
- package/dist/common/types/predicate.d.ts +1 -0
- package/dist/common/types/unionContain.d.ts +1 -1
- package/dist/dataParser/base.cjs +116 -0
- package/dist/dataParser/base.d.ts +44 -0
- package/dist/dataParser/base.mjs +109 -0
- package/dist/dataParser/baseExtended.cjs +55 -0
- package/dist/dataParser/baseExtended.d.ts +45 -0
- package/dist/dataParser/baseExtended.mjs +52 -0
- package/dist/dataParser/error.cjs +54 -0
- package/dist/dataParser/error.d.ts +31 -0
- package/dist/dataParser/error.mjs +41 -0
- package/dist/dataParser/extended/array.cjs +20 -0
- package/dist/dataParser/extended/array.d.ts +21 -0
- package/dist/dataParser/extended/array.mjs +18 -0
- package/dist/dataParser/extended/bigint.cjs +20 -0
- package/dist/dataParser/extended/bigint.d.ts +19 -0
- package/dist/dataParser/extended/bigint.mjs +18 -0
- package/dist/dataParser/extended/boolean.cjs +11 -0
- package/dist/dataParser/extended/boolean.d.ts +9 -0
- package/dist/dataParser/extended/boolean.mjs +9 -0
- package/dist/dataParser/extended/coerce/bigint.cjs +13 -0
- package/dist/dataParser/extended/coerce/bigint.d.ts +7 -0
- package/dist/dataParser/extended/coerce/bigint.mjs +11 -0
- package/dist/dataParser/extended/coerce/boolean.cjs +13 -0
- package/dist/dataParser/extended/coerce/boolean.d.ts +7 -0
- package/dist/dataParser/extended/coerce/boolean.mjs +11 -0
- package/dist/dataParser/extended/coerce/empty.cjs +13 -0
- package/dist/dataParser/extended/coerce/empty.d.ts +7 -0
- package/dist/dataParser/extended/coerce/empty.mjs +11 -0
- package/dist/dataParser/extended/coerce/index.cjs +17 -0
- package/dist/dataParser/extended/coerce/index.d.ts +6 -0
- package/dist/dataParser/extended/coerce/index.mjs +6 -0
- package/dist/dataParser/extended/coerce/nil.cjs +13 -0
- package/dist/dataParser/extended/coerce/nil.d.ts +7 -0
- package/dist/dataParser/extended/coerce/nil.mjs +11 -0
- package/dist/dataParser/extended/coerce/number.cjs +13 -0
- package/dist/dataParser/extended/coerce/number.d.ts +7 -0
- package/dist/dataParser/extended/coerce/number.mjs +11 -0
- package/dist/dataParser/extended/coerce/string.cjs +13 -0
- package/dist/dataParser/extended/coerce/string.d.ts +7 -0
- package/dist/dataParser/extended/coerce/string.mjs +11 -0
- package/dist/dataParser/extended/empty.cjs +11 -0
- package/dist/dataParser/extended/empty.d.ts +9 -0
- package/dist/dataParser/extended/empty.mjs +9 -0
- package/dist/dataParser/extended/index.cjs +48 -0
- package/dist/dataParser/extended/index.d.ts +22 -0
- package/dist/dataParser/extended/index.mjs +21 -0
- package/dist/dataParser/extended/lazy.cjs +11 -0
- package/dist/dataParser/extended/lazy.d.ts +11 -0
- package/dist/dataParser/extended/lazy.mjs +9 -0
- package/dist/dataParser/extended/literal.cjs +11 -0
- package/dist/dataParser/extended/literal.d.ts +11 -0
- package/dist/dataParser/extended/literal.mjs +9 -0
- package/dist/dataParser/extended/nil.cjs +11 -0
- package/dist/dataParser/extended/nil.d.ts +9 -0
- package/dist/dataParser/extended/nil.mjs +9 -0
- package/dist/dataParser/extended/nullable.cjs +11 -0
- package/dist/dataParser/extended/nullable.d.ts +11 -0
- package/dist/dataParser/extended/nullable.mjs +9 -0
- package/dist/dataParser/extended/number.cjs +27 -0
- package/dist/dataParser/extended/number.d.ts +24 -0
- package/dist/dataParser/extended/number.mjs +24 -0
- package/dist/dataParser/extended/object.cjs +11 -0
- package/dist/dataParser/extended/object.d.ts +11 -0
- package/dist/dataParser/extended/object.mjs +9 -0
- package/dist/dataParser/extended/optional.cjs +11 -0
- package/dist/dataParser/extended/optional.d.ts +11 -0
- package/dist/dataParser/extended/optional.mjs +9 -0
- package/dist/dataParser/extended/pipe.cjs +11 -0
- package/dist/dataParser/extended/pipe.d.ts +12 -0
- package/dist/dataParser/extended/pipe.mjs +9 -0
- package/dist/dataParser/extended/record.cjs +11 -0
- package/dist/dataParser/extended/record.d.ts +12 -0
- package/dist/dataParser/extended/record.mjs +9 -0
- package/dist/dataParser/extended/string.cjs +38 -0
- package/dist/dataParser/extended/string.d.ts +32 -0
- package/dist/dataParser/extended/string.mjs +34 -0
- package/dist/dataParser/extended/templateLiteral.cjs +10 -0
- package/dist/dataParser/extended/templateLiteral.d.ts +11 -0
- package/dist/dataParser/extended/templateLiteral.mjs +8 -0
- package/dist/dataParser/extended/transform.cjs +11 -0
- package/dist/dataParser/extended/transform.d.ts +14 -0
- package/dist/dataParser/extended/transform.mjs +9 -0
- package/dist/dataParser/extended/tuple.cjs +11 -0
- package/dist/dataParser/extended/tuple.d.ts +11 -0
- package/dist/dataParser/extended/tuple.mjs +9 -0
- package/dist/dataParser/extended/union.cjs +11 -0
- package/dist/dataParser/extended/union.d.ts +11 -0
- package/dist/dataParser/extended/union.mjs +9 -0
- package/dist/dataParser/extended/unknown.cjs +11 -0
- package/dist/dataParser/extended/unknown.d.ts +9 -0
- package/dist/dataParser/extended/unknown.mjs +9 -0
- package/dist/dataParser/index.cjs +128 -0
- package/dist/dataParser/index.d.ts +6 -0
- package/dist/dataParser/index.mjs +38 -0
- package/dist/dataParser/kind.cjs +7 -0
- package/dist/dataParser/kind.d.ts +1 -0
- package/dist/dataParser/kind.mjs +5 -0
- package/dist/dataParser/parsers/array/checkers/index.d.ts +2 -0
- package/dist/dataParser/parsers/array/checkers/max.cjs +23 -0
- package/dist/dataParser/parsers/array/checkers/max.d.ts +11 -0
- package/dist/dataParser/parsers/array/checkers/max.mjs +20 -0
- package/dist/dataParser/parsers/array/checkers/min.cjs +23 -0
- package/dist/dataParser/parsers/array/checkers/min.d.ts +11 -0
- package/dist/dataParser/parsers/array/checkers/min.mjs +20 -0
- package/dist/dataParser/parsers/array/index.cjs +64 -0
- package/dist/dataParser/parsers/array/index.d.ts +20 -0
- package/dist/dataParser/parsers/array/index.mjs +61 -0
- package/dist/dataParser/parsers/bigint/checkers/index.d.ts +2 -0
- package/dist/dataParser/parsers/bigint/checkers/max.cjs +23 -0
- package/dist/dataParser/parsers/bigint/checkers/max.d.ts +11 -0
- package/dist/dataParser/parsers/bigint/checkers/max.mjs +20 -0
- package/dist/dataParser/parsers/bigint/checkers/min.cjs +23 -0
- package/dist/dataParser/parsers/bigint/checkers/min.d.ts +11 -0
- package/dist/dataParser/parsers/bigint/checkers/min.mjs +20 -0
- package/dist/dataParser/parsers/bigint/index.cjs +31 -0
- package/dist/dataParser/parsers/bigint/index.d.ts +18 -0
- package/dist/dataParser/parsers/bigint/index.mjs +28 -0
- package/dist/dataParser/parsers/boolean.cjs +40 -0
- package/dist/dataParser/parsers/boolean.d.ts +12 -0
- package/dist/dataParser/parsers/boolean.mjs +37 -0
- package/dist/dataParser/parsers/coerce/bigint.cjs +13 -0
- package/dist/dataParser/parsers/coerce/bigint.d.ts +6 -0
- package/dist/dataParser/parsers/coerce/bigint.mjs +11 -0
- package/dist/dataParser/parsers/coerce/boolean.cjs +13 -0
- package/dist/dataParser/parsers/coerce/boolean.d.ts +6 -0
- package/dist/dataParser/parsers/coerce/boolean.mjs +11 -0
- package/dist/dataParser/parsers/coerce/empty.cjs +13 -0
- package/dist/dataParser/parsers/coerce/empty.d.ts +6 -0
- package/dist/dataParser/parsers/coerce/empty.mjs +11 -0
- package/dist/dataParser/parsers/coerce/index.cjs +17 -0
- package/dist/dataParser/parsers/coerce/index.d.ts +6 -0
- package/dist/dataParser/parsers/coerce/index.mjs +6 -0
- package/dist/dataParser/parsers/coerce/nil.cjs +13 -0
- package/dist/dataParser/parsers/coerce/nil.d.ts +6 -0
- package/dist/dataParser/parsers/coerce/nil.mjs +11 -0
- package/dist/dataParser/parsers/coerce/number.cjs +13 -0
- package/dist/dataParser/parsers/coerce/number.d.ts +6 -0
- package/dist/dataParser/parsers/coerce/number.mjs +11 -0
- package/dist/dataParser/parsers/coerce/string.cjs +13 -0
- package/dist/dataParser/parsers/coerce/string.d.ts +6 -0
- package/dist/dataParser/parsers/coerce/string.mjs +11 -0
- package/dist/dataParser/parsers/empty.cjs +27 -0
- package/dist/dataParser/parsers/empty.d.ts +12 -0
- package/dist/dataParser/parsers/empty.mjs +24 -0
- package/dist/dataParser/parsers/index.d.ts +20 -0
- package/dist/dataParser/parsers/lazy.cjs +21 -0
- package/dist/dataParser/parsers/lazy.d.ts +14 -0
- package/dist/dataParser/parsers/lazy.mjs +18 -0
- package/dist/dataParser/parsers/literal.cjs +25 -0
- package/dist/dataParser/parsers/literal.d.ts +15 -0
- package/dist/dataParser/parsers/literal.mjs +22 -0
- package/dist/dataParser/parsers/nil.cjs +27 -0
- package/dist/dataParser/parsers/nil.d.ts +12 -0
- package/dist/dataParser/parsers/nil.mjs +24 -0
- package/dist/dataParser/parsers/nullable.cjs +31 -0
- package/dist/dataParser/parsers/nullable.d.ts +14 -0
- package/dist/dataParser/parsers/nullable.mjs +28 -0
- package/dist/dataParser/parsers/number/checkers/index.d.ts +3 -0
- package/dist/dataParser/parsers/number/checkers/int.cjs +27 -0
- package/dist/dataParser/parsers/number/checkers/int.d.ts +15 -0
- package/dist/dataParser/parsers/number/checkers/int.mjs +23 -0
- package/dist/dataParser/parsers/number/checkers/max.cjs +18 -0
- package/dist/dataParser/parsers/number/checkers/max.d.ts +11 -0
- package/dist/dataParser/parsers/number/checkers/max.mjs +15 -0
- package/dist/dataParser/parsers/number/checkers/min.cjs +18 -0
- package/dist/dataParser/parsers/number/checkers/min.d.ts +11 -0
- package/dist/dataParser/parsers/number/checkers/min.mjs +15 -0
- package/dist/dataParser/parsers/number/index.cjs +31 -0
- package/dist/dataParser/parsers/number/index.d.ts +18 -0
- package/dist/dataParser/parsers/number/index.mjs +28 -0
- package/dist/dataParser/parsers/object.cjs +74 -0
- package/dist/dataParser/parsers/object.d.ts +26 -0
- package/dist/dataParser/parsers/object.mjs +71 -0
- package/dist/dataParser/parsers/optional.cjs +31 -0
- package/dist/dataParser/parsers/optional.d.ts +14 -0
- package/dist/dataParser/parsers/optional.mjs +28 -0
- package/dist/dataParser/parsers/pipe.cjs +34 -0
- package/dist/dataParser/parsers/pipe.d.ts +16 -0
- package/dist/dataParser/parsers/pipe.mjs +31 -0
- package/dist/dataParser/parsers/record.cjs +83 -0
- package/dist/dataParser/parsers/record.d.ts +30 -0
- package/dist/dataParser/parsers/record.mjs +80 -0
- package/dist/dataParser/parsers/string/checkers/email.cjs +31 -0
- package/dist/dataParser/parsers/string/checkers/email.d.ts +17 -0
- package/dist/dataParser/parsers/string/checkers/email.mjs +27 -0
- package/dist/dataParser/parsers/string/checkers/index.d.ts +5 -0
- package/dist/dataParser/parsers/string/checkers/max.cjs +18 -0
- package/dist/dataParser/parsers/string/checkers/max.d.ts +11 -0
- package/dist/dataParser/parsers/string/checkers/max.mjs +15 -0
- package/dist/dataParser/parsers/string/checkers/min.cjs +18 -0
- package/dist/dataParser/parsers/string/checkers/min.d.ts +11 -0
- package/dist/dataParser/parsers/string/checkers/min.mjs +15 -0
- package/dist/dataParser/parsers/string/checkers/regex.cjs +20 -0
- package/dist/dataParser/parsers/string/checkers/regex.d.ts +11 -0
- package/dist/dataParser/parsers/string/checkers/regex.mjs +17 -0
- package/dist/dataParser/parsers/string/checkers/url.cjs +48 -0
- package/dist/dataParser/parsers/string/checkers/url.d.ts +18 -0
- package/dist/dataParser/parsers/string/checkers/url.mjs +44 -0
- package/dist/dataParser/parsers/string/index.cjs +31 -0
- package/dist/dataParser/parsers/string/index.d.ts +18 -0
- package/dist/dataParser/parsers/string/index.mjs +28 -0
- package/dist/dataParser/parsers/templateLiteral.cjs +45 -0
- package/dist/dataParser/parsers/templateLiteral.d.ts +49 -0
- package/dist/dataParser/parsers/templateLiteral.mjs +42 -0
- package/dist/dataParser/parsers/transform.cjs +43 -0
- package/dist/dataParser/parsers/transform.d.ts +17 -0
- package/dist/dataParser/parsers/transform.mjs +40 -0
- package/dist/dataParser/parsers/tuple.cjs +83 -0
- package/dist/dataParser/parsers/tuple.d.ts +33 -0
- package/dist/dataParser/parsers/tuple.mjs +80 -0
- package/dist/dataParser/parsers/union.cjs +38 -0
- package/dist/dataParser/parsers/union.d.ts +15 -0
- package/dist/dataParser/parsers/union.mjs +35 -0
- package/dist/dataParser/parsers/unknown.cjs +17 -0
- package/dist/dataParser/parsers/unknown.d.ts +11 -0
- package/dist/dataParser/parsers/unknown.mjs +14 -0
- package/dist/dataParser/types/addCheckersToDefinition.d.ts +5 -0
- package/dist/dataParser/types/checkers.d.ts +3 -0
- package/dist/dataParser/types/dataParsers.d.ts +5 -0
- package/dist/dataParser/types/index.d.ts +4 -0
- package/dist/dataParser/types/mergeDefinition.d.ts +5 -0
- package/dist/either/bool/base.cjs +2 -2
- package/dist/either/bool/base.d.ts +1 -1
- package/dist/either/bool/base.mjs +2 -2
- package/dist/either/bool/falsy.cjs +5 -5
- package/dist/either/bool/falsy.d.ts +4 -4
- package/dist/either/bool/falsy.mjs +5 -5
- package/dist/either/bool/truthy.cjs +4 -4
- package/dist/either/bool/truthy.d.ts +5 -5
- package/dist/either/bool/truthy.mjs +4 -4
- package/dist/either/future/base.cjs +2 -2
- package/dist/either/future/base.d.ts +1 -1
- package/dist/either/future/base.mjs +2 -2
- package/dist/either/future/error.cjs +3 -3
- package/dist/either/future/error.d.ts +1 -1
- package/dist/either/future/error.mjs +3 -3
- package/dist/either/future/success.cjs +3 -3
- package/dist/either/future/success.d.ts +2 -2
- package/dist/either/future/success.mjs +3 -3
- package/dist/either/hasInformation.cjs +3 -3
- package/dist/either/hasInformation.d.ts +1 -1
- package/dist/either/hasInformation.mjs +1 -1
- package/dist/either/index.cjs +3 -2
- package/dist/either/index.d.ts +1 -1
- package/dist/either/index.mjs +1 -1
- package/dist/either/kind.cjs +9 -0
- package/dist/either/kind.d.ts +2 -0
- package/dist/either/kind.mjs +6 -0
- package/dist/either/left/create.cjs +3 -4
- package/dist/either/left/create.d.ts +2 -2
- package/dist/either/left/create.mjs +3 -4
- package/dist/either/left/error.cjs +3 -3
- package/dist/either/left/error.d.ts +1 -1
- package/dist/either/left/error.mjs +3 -3
- package/dist/either/left/fail.cjs +3 -3
- package/dist/either/left/fail.d.ts +1 -1
- package/dist/either/left/fail.mjs +3 -3
- package/dist/either/left/is.cjs +2 -2
- package/dist/either/left/is.mjs +1 -1
- package/dist/either/nullable/base.cjs +2 -2
- package/dist/either/nullable/base.d.ts +1 -1
- package/dist/either/nullable/base.mjs +2 -2
- package/dist/either/nullable/empty.cjs +3 -3
- package/dist/either/nullable/empty.d.ts +1 -1
- package/dist/either/nullable/empty.mjs +3 -3
- package/dist/either/nullable/filled.cjs +3 -3
- package/dist/either/nullable/filled.d.ts +1 -1
- package/dist/either/nullable/filled.mjs +3 -3
- package/dist/either/nullish/base.cjs +2 -2
- package/dist/either/nullish/base.d.ts +1 -1
- package/dist/either/nullish/base.mjs +2 -2
- package/dist/either/nullish/empty.cjs +3 -3
- package/dist/either/nullish/empty.d.ts +2 -2
- package/dist/either/nullish/empty.mjs +3 -3
- package/dist/either/nullish/filled.cjs +4 -4
- package/dist/either/nullish/filled.d.ts +1 -1
- package/dist/either/nullish/filled.mjs +4 -4
- package/dist/either/optional/base.cjs +2 -2
- package/dist/either/optional/base.d.ts +1 -1
- package/dist/either/optional/base.mjs +2 -2
- package/dist/either/optional/empty.cjs +5 -5
- package/dist/either/optional/empty.d.ts +3 -3
- package/dist/either/optional/empty.mjs +5 -5
- package/dist/either/optional/filled.cjs +5 -5
- package/dist/either/optional/filled.d.ts +3 -3
- package/dist/either/optional/filled.mjs +5 -5
- package/dist/either/right/asyncPipe.d.ts +2 -2
- package/dist/either/right/create.cjs +3 -4
- package/dist/either/right/create.d.ts +2 -2
- package/dist/either/right/create.mjs +3 -4
- package/dist/either/right/is.cjs +2 -2
- package/dist/either/right/is.mjs +1 -1
- package/dist/either/right/ok.cjs +3 -3
- package/dist/either/right/ok.d.ts +1 -1
- package/dist/either/right/ok.mjs +3 -3
- package/dist/either/right/success.cjs +3 -3
- package/dist/either/right/success.d.ts +2 -2
- package/dist/either/right/success.mjs +3 -3
- package/dist/either/whenHasInformation.cjs +2 -2
- package/dist/either/whenHasInformation.d.ts +1 -1
- package/dist/either/whenHasInformation.mjs +1 -1
- package/dist/generator/reduce.cjs +1 -1
- package/dist/generator/reduce.mjs +1 -1
- package/dist/index.cjs +15 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +12 -1
- package/dist/number/greater.cjs +12 -0
- package/dist/number/greater.d.ts +2 -0
- package/dist/number/greater.mjs +10 -0
- package/dist/number/greaterThan.cjs +12 -0
- package/dist/number/greaterThan.d.ts +2 -0
- package/dist/number/greaterThan.mjs +10 -0
- package/dist/number/index.cjs +8 -0
- package/dist/number/index.d.ts +4 -0
- package/dist/number/index.mjs +4 -0
- package/dist/number/less.cjs +12 -0
- package/dist/number/less.d.ts +2 -0
- package/dist/number/less.mjs +10 -0
- package/dist/number/lessThan.cjs +12 -0
- package/dist/number/lessThan.d.ts +2 -0
- package/dist/number/lessThan.mjs +10 -0
- package/dist/object/fromEntries.d.ts +1 -1
- package/dist/object/types/getPropsWithValueExtends.d.ts +1 -1
- package/dist/pattern/result.cjs +1 -1
- package/dist/pattern/result.mjs +1 -1
- package/dist/string/types/forbiddenCharacters.d.ts +5 -0
- package/dist/string/types/index.d.ts +1 -0
- package/package.json +57 -1
- package/dist/either/base.cjs +0 -7
- package/dist/either/base.d.ts +0 -1
- package/dist/either/base.mjs +0 -5
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('../../common/kind.cjs');
|
|
4
3
|
var wrapValue = require('../../common/wrapValue.cjs');
|
|
5
|
-
var
|
|
4
|
+
var kind = require('../kind.cjs');
|
|
6
5
|
|
|
7
|
-
const eitherLeftKind = kind.
|
|
6
|
+
const eitherLeftKind = kind.createEitherKind("left");
|
|
8
7
|
function left(information, value = undefined) {
|
|
9
|
-
return eitherLeftKind.
|
|
8
|
+
return eitherLeftKind.setTo(kind.eitherInformationKind.setTo(wrapValue.wrapValue(value), information));
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
exports.eitherLeftKind = eitherLeftKind;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Kind } from "../../common/kind";
|
|
2
2
|
import { type WrappedValue } from "../../common/wrapValue";
|
|
3
|
-
import { eitherInformationKind } from "../
|
|
4
|
-
export declare const eitherLeftKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"
|
|
3
|
+
import { eitherInformationKind } from "../kind";
|
|
4
|
+
export declare const eitherLeftKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/left", unknown>>;
|
|
5
5
|
type _EitherLeft<GenericInformation extends string = string, GenericValue extends unknown = unknown> = (Kind<typeof eitherLeftKind.definition> & Kind<typeof eitherInformationKind.definition, GenericInformation> & WrappedValue<GenericValue>);
|
|
6
6
|
export interface EitherLeft<GenericInformation extends string = string, GenericValue extends unknown = unknown> extends _EitherLeft<GenericInformation, GenericValue> {
|
|
7
7
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { createKind } from '../../common/kind.mjs';
|
|
2
1
|
import { wrapValue } from '../../common/wrapValue.mjs';
|
|
3
|
-
import { eitherInformationKind } from '../
|
|
2
|
+
import { createEitherKind, eitherInformationKind } from '../kind.mjs';
|
|
4
3
|
|
|
5
|
-
const eitherLeftKind =
|
|
4
|
+
const eitherLeftKind = createEitherKind("left");
|
|
6
5
|
function left(information, value = undefined) {
|
|
7
|
-
return eitherLeftKind.
|
|
6
|
+
return eitherLeftKind.setTo(eitherInformationKind.setTo(wrapValue(value), information));
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
export { eitherLeftKind, left };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('
|
|
3
|
+
var kind = require('../kind.cjs');
|
|
4
4
|
var create = require('./create.cjs');
|
|
5
5
|
|
|
6
|
-
const eitherErrorKind = kind.
|
|
6
|
+
const eitherErrorKind = kind.createEitherKind("error");
|
|
7
7
|
function error(value) {
|
|
8
|
-
return eitherErrorKind.
|
|
8
|
+
return eitherErrorKind.setTo(create.left("error", value));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
exports.eitherErrorKind = eitherErrorKind;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Kind } from "../../common/kind";
|
|
2
2
|
import { type EitherLeft } from "./create";
|
|
3
|
-
export declare const eitherErrorKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"
|
|
3
|
+
export declare const eitherErrorKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/error", unknown>>;
|
|
4
4
|
type _EitherError<GenericValue extends unknown = unknown> = (EitherLeft<"error", GenericValue> & Kind<typeof eitherErrorKind.definition>);
|
|
5
5
|
export interface EitherError<GenericValue extends unknown = unknown> extends _EitherError<GenericValue> {
|
|
6
6
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createEitherKind } from '../kind.mjs';
|
|
2
2
|
import { left } from './create.mjs';
|
|
3
3
|
|
|
4
|
-
const eitherErrorKind =
|
|
4
|
+
const eitherErrorKind = createEitherKind("error");
|
|
5
5
|
function error(value) {
|
|
6
|
-
return eitherErrorKind.
|
|
6
|
+
return eitherErrorKind.setTo(left("error", value));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { eitherErrorKind, error };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('
|
|
3
|
+
var kind = require('../kind.cjs');
|
|
4
4
|
var create = require('./create.cjs');
|
|
5
5
|
|
|
6
|
-
const eitherFailKind = kind.
|
|
6
|
+
const eitherFailKind = kind.createEitherKind("fail");
|
|
7
7
|
function fail() {
|
|
8
|
-
return eitherFailKind.
|
|
8
|
+
return eitherFailKind.setTo(create.left("fail", undefined));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
exports.eitherFailKind = eitherFailKind;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Kind } from "../../common/kind";
|
|
2
2
|
import { type EitherLeft } from "./create";
|
|
3
|
-
export declare const eitherFailKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"
|
|
3
|
+
export declare const eitherFailKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/fail", unknown>>;
|
|
4
4
|
type _EitherFail = (EitherLeft<"fail", never> & Kind<typeof eitherFailKind.definition>);
|
|
5
5
|
export interface EitherFail extends _EitherFail {
|
|
6
6
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createEitherKind } from '../kind.mjs';
|
|
2
2
|
import { left } from './create.mjs';
|
|
3
3
|
|
|
4
|
-
const eitherFailKind =
|
|
4
|
+
const eitherFailKind = createEitherKind("fail");
|
|
5
5
|
function fail() {
|
|
6
|
-
return eitherFailKind.
|
|
6
|
+
return eitherFailKind.setTo(left("fail", undefined));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { eitherFailKind, fail };
|
package/dist/either/left/is.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var create = require('./create.cjs');
|
|
4
4
|
var wrapValue = require('../../common/wrapValue.cjs');
|
|
5
|
-
var
|
|
5
|
+
var kind = require('../kind.cjs');
|
|
6
6
|
|
|
7
7
|
function isLeft(input) {
|
|
8
8
|
return create.eitherLeftKind.has(input)
|
|
9
|
-
&&
|
|
9
|
+
&& kind.eitherInformationKind.has(input)
|
|
10
10
|
&& wrapValue.isWrappedValue(input);
|
|
11
11
|
}
|
|
12
12
|
|
package/dist/either/left/is.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { eitherLeftKind } from './create.mjs';
|
|
2
2
|
import { isWrappedValue } from '../../common/wrapValue.mjs';
|
|
3
|
-
import { eitherInformationKind } from '../
|
|
3
|
+
import { eitherInformationKind } from '../kind.mjs';
|
|
4
4
|
|
|
5
5
|
function isLeft(input) {
|
|
6
6
|
return eitherLeftKind.has(input)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('
|
|
3
|
+
var kind = require('../kind.cjs');
|
|
4
4
|
|
|
5
|
-
const eitherNullableKind = kind.
|
|
5
|
+
const eitherNullableKind = kind.createEitherKind("nullable");
|
|
6
6
|
|
|
7
7
|
exports.eitherNullableKind = eitherNullableKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const eitherNullableKind: import("
|
|
1
|
+
export declare const eitherNullableKind: import("../..").KindHandler<import("../..").KindDefinition<"@Either/nullable", unknown>>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('../../common/kind.cjs');
|
|
4
3
|
var unwrap = require('../../common/unwrap.cjs');
|
|
5
4
|
var create = require('../left/create.cjs');
|
|
5
|
+
var kind = require('../kind.cjs');
|
|
6
6
|
var is = require('../left/is.cjs');
|
|
7
7
|
var is$1 = require('../right/is.cjs');
|
|
8
8
|
var create$1 = require('./create.cjs');
|
|
9
9
|
var base = require('./base.cjs');
|
|
10
10
|
|
|
11
|
-
const eitherNullableEmptyKind = kind.
|
|
11
|
+
const eitherNullableEmptyKind = kind.createEitherKind("nullable-empty");
|
|
12
12
|
function nullableEmpty() {
|
|
13
|
-
return base.eitherNullableKind.
|
|
13
|
+
return base.eitherNullableKind.setTo(eitherNullableEmptyKind.setTo(create.left("nullable", null)));
|
|
14
14
|
}
|
|
15
15
|
function isNullableEmpty(input) {
|
|
16
16
|
return is.isLeft(input)
|
|
@@ -4,7 +4,7 @@ import { type EitherLeft } from "../left";
|
|
|
4
4
|
import { type EitherRight } from "../right";
|
|
5
5
|
import { nullable } from "./create";
|
|
6
6
|
import { eitherNullableKind } from "./base";
|
|
7
|
-
export declare const eitherNullableEmptyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"
|
|
7
|
+
export declare const eitherNullableEmptyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/nullable-empty", unknown>>;
|
|
8
8
|
type _EitherNullableEmpty = (EitherLeft<"nullable", null> & Kind<typeof eitherNullableKind.definition> & Kind<typeof eitherNullableEmptyKind.definition>);
|
|
9
9
|
export interface EitherNullableEmpty extends _EitherNullableEmpty {
|
|
10
10
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { createKind } from '../../common/kind.mjs';
|
|
2
1
|
import { unwrap } from '../../common/unwrap.mjs';
|
|
3
2
|
import { left } from '../left/create.mjs';
|
|
3
|
+
import { createEitherKind } from '../kind.mjs';
|
|
4
4
|
import { isLeft } from '../left/is.mjs';
|
|
5
5
|
import { isRight } from '../right/is.mjs';
|
|
6
6
|
import { nullable } from './create.mjs';
|
|
7
7
|
import { eitherNullableKind } from './base.mjs';
|
|
8
8
|
|
|
9
|
-
const eitherNullableEmptyKind =
|
|
9
|
+
const eitherNullableEmptyKind = createEitherKind("nullable-empty");
|
|
10
10
|
function nullableEmpty() {
|
|
11
|
-
return eitherNullableKind.
|
|
11
|
+
return eitherNullableKind.setTo(eitherNullableEmptyKind.setTo(left("nullable", null)));
|
|
12
12
|
}
|
|
13
13
|
function isNullableEmpty(input) {
|
|
14
14
|
return isLeft(input)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('../../common/kind.cjs');
|
|
4
3
|
var unwrap = require('../../common/unwrap.cjs');
|
|
4
|
+
var kind = require('../kind.cjs');
|
|
5
5
|
var is$1 = require('../left/is.cjs');
|
|
6
6
|
var create = require('../right/create.cjs');
|
|
7
7
|
var is = require('../right/is.cjs');
|
|
8
8
|
var create$1 = require('./create.cjs');
|
|
9
9
|
var base = require('./base.cjs');
|
|
10
10
|
|
|
11
|
-
const eitherNullableFilledKind = kind.
|
|
11
|
+
const eitherNullableFilledKind = kind.createEitherKind("nullable-filled");
|
|
12
12
|
function nullableFilled(value) {
|
|
13
|
-
return base.eitherNullableKind.
|
|
13
|
+
return base.eitherNullableKind.setTo(eitherNullableFilledKind.setTo(create.right("nullable", value)));
|
|
14
14
|
}
|
|
15
15
|
function isNullableFilled(input) {
|
|
16
16
|
return is.isRight(input)
|
|
@@ -4,7 +4,7 @@ import { type EitherLeft } from "../left";
|
|
|
4
4
|
import { type EitherRight } from "../right";
|
|
5
5
|
import { nullable } from "./create";
|
|
6
6
|
import { eitherNullableKind } from "./base";
|
|
7
|
-
export declare const eitherNullableFilledKind: import("../../common").KindHandler<import("../../common").KindDefinition<"
|
|
7
|
+
export declare const eitherNullableFilledKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/nullable-filled", unknown>>;
|
|
8
8
|
type _EitherNullableFilled<GenericValue extends unknown = unknown> = (EitherRight<"nullable", GenericValue> & Kind<typeof eitherNullableKind.definition> & Kind<typeof eitherNullableFilledKind.definition>);
|
|
9
9
|
export interface EitherNullableFilled<GenericValue extends unknown = unknown> extends _EitherNullableFilled<GenericValue> {
|
|
10
10
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { createKind } from '../../common/kind.mjs';
|
|
2
1
|
import { unwrap } from '../../common/unwrap.mjs';
|
|
2
|
+
import { createEitherKind } from '../kind.mjs';
|
|
3
3
|
import { isLeft } from '../left/is.mjs';
|
|
4
4
|
import { right } from '../right/create.mjs';
|
|
5
5
|
import { isRight } from '../right/is.mjs';
|
|
6
6
|
import { nullable } from './create.mjs';
|
|
7
7
|
import { eitherNullableKind } from './base.mjs';
|
|
8
8
|
|
|
9
|
-
const eitherNullableFilledKind =
|
|
9
|
+
const eitherNullableFilledKind = createEitherKind("nullable-filled");
|
|
10
10
|
function nullableFilled(value) {
|
|
11
|
-
return eitherNullableKind.
|
|
11
|
+
return eitherNullableKind.setTo(eitherNullableFilledKind.setTo(right("nullable", value)));
|
|
12
12
|
}
|
|
13
13
|
function isNullableFilled(input) {
|
|
14
14
|
return isRight(input)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('
|
|
3
|
+
var kind = require('../kind.cjs');
|
|
4
4
|
|
|
5
|
-
const eitherNullishKind = kind.
|
|
5
|
+
const eitherNullishKind = kind.createEitherKind("nullish");
|
|
6
6
|
|
|
7
7
|
exports.eitherNullishKind = eitherNullishKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const eitherNullishKind: import("
|
|
1
|
+
export declare const eitherNullishKind: import("../..").KindHandler<import("../..").KindDefinition<"@Either/nullish", unknown>>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('../../common/kind.cjs');
|
|
4
3
|
var unwrap = require('../../common/unwrap.cjs');
|
|
4
|
+
var kind = require('../kind.cjs');
|
|
5
5
|
var create = require('../left/create.cjs');
|
|
6
6
|
var is = require('../left/is.cjs');
|
|
7
7
|
var is$1 = require('../right/is.cjs');
|
|
8
8
|
var create$1 = require('./create.cjs');
|
|
9
9
|
var base = require('./base.cjs');
|
|
10
10
|
|
|
11
|
-
const eitherNullishEmptyKind = kind.
|
|
11
|
+
const eitherNullishEmptyKind = kind.createEitherKind("nullish-empty");
|
|
12
12
|
function nullishEmpty(value = undefined) {
|
|
13
|
-
return base.eitherNullishKind.
|
|
13
|
+
return base.eitherNullishKind.setTo(eitherNullishEmptyKind.setTo(create.left("nullish", value)));
|
|
14
14
|
}
|
|
15
15
|
function isNullishEmpty(input) {
|
|
16
16
|
return is.isLeft(input)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common";
|
|
2
|
+
import { type Kind } from "../../common/kind";
|
|
2
3
|
import { type EitherLeft } from "../left";
|
|
3
4
|
import { type EitherRight } from "../right";
|
|
4
5
|
import { nullish } from "./create";
|
|
5
|
-
import { type Kind } from "../../common/kind";
|
|
6
6
|
import { eitherNullishKind } from "./base";
|
|
7
7
|
export type NullishValue = null | undefined;
|
|
8
|
-
export declare const eitherNullishEmptyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"
|
|
8
|
+
export declare const eitherNullishEmptyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/nullish-empty", unknown>>;
|
|
9
9
|
type _EitherNullishEmpty<GenericValue extends NullishValue = NullishValue> = (EitherLeft<"nullish", GenericValue> & Kind<typeof eitherNullishKind.definition> & Kind<typeof eitherNullishEmptyKind.definition>);
|
|
10
10
|
export interface EitherNullishEmpty<GenericValue extends NullishValue = NullishValue> extends _EitherNullishEmpty<GenericValue> {
|
|
11
11
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { createKind } from '../../common/kind.mjs';
|
|
2
1
|
import { unwrap } from '../../common/unwrap.mjs';
|
|
2
|
+
import { createEitherKind } from '../kind.mjs';
|
|
3
3
|
import { left } from '../left/create.mjs';
|
|
4
4
|
import { isLeft } from '../left/is.mjs';
|
|
5
5
|
import { isRight } from '../right/is.mjs';
|
|
6
6
|
import { nullish } from './create.mjs';
|
|
7
7
|
import { eitherNullishKind } from './base.mjs';
|
|
8
8
|
|
|
9
|
-
const eitherNullishEmptyKind =
|
|
9
|
+
const eitherNullishEmptyKind = createEitherKind("nullish-empty");
|
|
10
10
|
function nullishEmpty(value = undefined) {
|
|
11
|
-
return eitherNullishKind.
|
|
11
|
+
return eitherNullishKind.setTo(eitherNullishEmptyKind.setTo(left("nullish", value)));
|
|
12
12
|
}
|
|
13
13
|
function isNullishEmpty(input) {
|
|
14
14
|
return isLeft(input)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('
|
|
4
|
-
var unwrap = require('../../common/unwrap.cjs');
|
|
3
|
+
var kind = require('../kind.cjs');
|
|
5
4
|
var is$1 = require('../left/is.cjs');
|
|
5
|
+
var unwrap = require('../../common/unwrap.cjs');
|
|
6
6
|
var create = require('../right/create.cjs');
|
|
7
7
|
var is = require('../right/is.cjs');
|
|
8
8
|
var create$1 = require('./create.cjs');
|
|
9
9
|
var base = require('./base.cjs');
|
|
10
10
|
|
|
11
|
-
const eitherNullishFilledKind = kind.
|
|
11
|
+
const eitherNullishFilledKind = kind.createEitherKind("nullish-filled");
|
|
12
12
|
function nullishFilled(value) {
|
|
13
|
-
return base.eitherNullishKind.
|
|
13
|
+
return base.eitherNullishKind.setTo(eitherNullishFilledKind.setTo(create.right("nullish", value)));
|
|
14
14
|
}
|
|
15
15
|
function isNullishFilled(input) {
|
|
16
16
|
return is.isRight(input)
|
|
@@ -4,7 +4,7 @@ import { nullish } from "./create";
|
|
|
4
4
|
import { type Kind } from "../../common/kind";
|
|
5
5
|
import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common";
|
|
6
6
|
import { eitherNullishKind } from "./base";
|
|
7
|
-
export declare const eitherNullishFilledKind: import("../../common").KindHandler<import("../../common").KindDefinition<"
|
|
7
|
+
export declare const eitherNullishFilledKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/nullish-filled", unknown>>;
|
|
8
8
|
type _EitherNullishFilled<GenericValue extends unknown = unknown> = (EitherRight<"nullish", GenericValue> & Kind<typeof eitherNullishKind.definition> & Kind<typeof eitherNullishFilledKind.definition>);
|
|
9
9
|
export interface EitherNullishFilled<GenericValue extends unknown = unknown> extends _EitherNullishFilled<GenericValue> {
|
|
10
10
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { unwrap } from '../../common/unwrap.mjs';
|
|
1
|
+
import { createEitherKind } from '../kind.mjs';
|
|
3
2
|
import { isLeft } from '../left/is.mjs';
|
|
3
|
+
import { unwrap } from '../../common/unwrap.mjs';
|
|
4
4
|
import { right } from '../right/create.mjs';
|
|
5
5
|
import { isRight } from '../right/is.mjs';
|
|
6
6
|
import { nullish } from './create.mjs';
|
|
7
7
|
import { eitherNullishKind } from './base.mjs';
|
|
8
8
|
|
|
9
|
-
const eitherNullishFilledKind =
|
|
9
|
+
const eitherNullishFilledKind = createEitherKind("nullish-filled");
|
|
10
10
|
function nullishFilled(value) {
|
|
11
|
-
return eitherNullishKind.
|
|
11
|
+
return eitherNullishKind.setTo(eitherNullishFilledKind.setTo(right("nullish", value)));
|
|
12
12
|
}
|
|
13
13
|
function isNullishFilled(input) {
|
|
14
14
|
return isRight(input)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('
|
|
3
|
+
var kind = require('../kind.cjs');
|
|
4
4
|
|
|
5
|
-
const eitherOptionalKind = kind.
|
|
5
|
+
const eitherOptionalKind = kind.createEitherKind("optional");
|
|
6
6
|
|
|
7
7
|
exports.eitherOptionalKind = eitherOptionalKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const eitherOptionalKind: import("
|
|
1
|
+
export declare const eitherOptionalKind: import("../..").KindHandler<import("../..").KindDefinition<"@Either/optional", unknown>>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('
|
|
3
|
+
var kind = require('../kind.cjs');
|
|
4
|
+
var base = require('./base.cjs');
|
|
5
|
+
var create$1 = require('./create.cjs');
|
|
4
6
|
var create = require('../left/create.cjs');
|
|
5
7
|
var is = require('../left/is.cjs');
|
|
6
8
|
var is$1 = require('../right/is.cjs');
|
|
7
|
-
var create$1 = require('./create.cjs');
|
|
8
|
-
var base = require('./base.cjs');
|
|
9
9
|
|
|
10
|
-
const eitherOptionalEmptyKind = kind.
|
|
10
|
+
const eitherOptionalEmptyKind = kind.createEitherKind("optional-empty");
|
|
11
11
|
function optionalEmpty() {
|
|
12
|
-
return base.eitherOptionalKind.
|
|
12
|
+
return base.eitherOptionalKind.setTo(eitherOptionalEmptyKind.setTo(create.left("optional", undefined)));
|
|
13
13
|
}
|
|
14
14
|
function isOptionalEmpty(input) {
|
|
15
15
|
return is.isLeft(input)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common";
|
|
2
2
|
import { type Kind } from "../../common/kind";
|
|
3
|
+
import { eitherOptionalKind } from "./base";
|
|
4
|
+
import { optional } from "./create";
|
|
3
5
|
import { type EitherLeft } from "../left";
|
|
4
6
|
import { type EitherRight } from "../right";
|
|
5
|
-
|
|
6
|
-
import { eitherOptionalKind } from "./base";
|
|
7
|
-
export declare const eitherOptionalEmptyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"either-optional-empty", unknown>>;
|
|
7
|
+
export declare const eitherOptionalEmptyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/optional-empty", unknown>>;
|
|
8
8
|
type _EitherOptionalEmpty = (EitherLeft<"optional", undefined> & Kind<typeof eitherOptionalKind.definition> & Kind<typeof eitherOptionalEmptyKind.definition>);
|
|
9
9
|
export interface EitherOptionalEmpty extends _EitherOptionalEmpty {
|
|
10
10
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createEitherKind } from '../kind.mjs';
|
|
2
|
+
import { eitherOptionalKind } from './base.mjs';
|
|
3
|
+
import { optional } from './create.mjs';
|
|
2
4
|
import { left } from '../left/create.mjs';
|
|
3
5
|
import { isLeft } from '../left/is.mjs';
|
|
4
6
|
import { isRight } from '../right/is.mjs';
|
|
5
|
-
import { optional } from './create.mjs';
|
|
6
|
-
import { eitherOptionalKind } from './base.mjs';
|
|
7
7
|
|
|
8
|
-
const eitherOptionalEmptyKind =
|
|
8
|
+
const eitherOptionalEmptyKind = createEitherKind("optional-empty");
|
|
9
9
|
function optionalEmpty() {
|
|
10
|
-
return eitherOptionalKind.
|
|
10
|
+
return eitherOptionalKind.setTo(eitherOptionalEmptyKind.setTo(left("optional", undefined)));
|
|
11
11
|
}
|
|
12
12
|
function isOptionalEmpty(input) {
|
|
13
13
|
return isLeft(input)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('../../common/kind.cjs');
|
|
4
3
|
var unwrap = require('../../common/unwrap.cjs');
|
|
4
|
+
var kind = require('../kind.cjs');
|
|
5
|
+
var base = require('./base.cjs');
|
|
6
|
+
var create$1 = require('./create.cjs');
|
|
5
7
|
var is$1 = require('../left/is.cjs');
|
|
6
8
|
var create = require('../right/create.cjs');
|
|
7
9
|
var is = require('../right/is.cjs');
|
|
8
|
-
var create$1 = require('./create.cjs');
|
|
9
|
-
var base = require('./base.cjs');
|
|
10
10
|
|
|
11
|
-
const eitherOptionalFilledKind = kind.
|
|
11
|
+
const eitherOptionalFilledKind = kind.createEitherKind("optional-filled");
|
|
12
12
|
function optionalFilled(value) {
|
|
13
|
-
return base.eitherOptionalKind.
|
|
13
|
+
return base.eitherOptionalKind.setTo(eitherOptionalFilledKind.setTo(create.right("optional", value)));
|
|
14
14
|
}
|
|
15
15
|
function isOptionalFilled(input) {
|
|
16
16
|
return is.isRight(input)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common";
|
|
2
2
|
import { type Kind } from "../../common/kind";
|
|
3
|
+
import { eitherOptionalKind } from "./base";
|
|
4
|
+
import { optional } from "./create";
|
|
3
5
|
import { type EitherLeft } from "../left";
|
|
4
6
|
import { type EitherRight } from "../right";
|
|
5
|
-
|
|
6
|
-
import { eitherOptionalKind } from "./base";
|
|
7
|
-
export declare const eitherOptionalFilledKind: import("../../common").KindHandler<import("../../common").KindDefinition<"either-optional-filled", unknown>>;
|
|
7
|
+
export declare const eitherOptionalFilledKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/optional-filled", unknown>>;
|
|
8
8
|
type _EitherOptionalFilled<GenericValue extends unknown = unknown> = (EitherRight<"optional", GenericValue> & Kind<typeof eitherOptionalKind.definition> & Kind<typeof eitherOptionalFilledKind.definition>);
|
|
9
9
|
export interface EitherOptionalFilled<GenericValue extends unknown = unknown> extends _EitherOptionalFilled<GenericValue> {
|
|
10
10
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { createKind } from '../../common/kind.mjs';
|
|
2
1
|
import { unwrap } from '../../common/unwrap.mjs';
|
|
2
|
+
import { createEitherKind } from '../kind.mjs';
|
|
3
|
+
import { eitherOptionalKind } from './base.mjs';
|
|
4
|
+
import { optional } from './create.mjs';
|
|
3
5
|
import { isLeft } from '../left/is.mjs';
|
|
4
6
|
import { right } from '../right/create.mjs';
|
|
5
7
|
import { isRight } from '../right/is.mjs';
|
|
6
|
-
import { optional } from './create.mjs';
|
|
7
|
-
import { eitherOptionalKind } from './base.mjs';
|
|
8
8
|
|
|
9
|
-
const eitherOptionalFilledKind =
|
|
9
|
+
const eitherOptionalFilledKind = createEitherKind("optional-filled");
|
|
10
10
|
function optionalFilled(value) {
|
|
11
|
-
return eitherOptionalKind.
|
|
11
|
+
return eitherOptionalKind.setTo(eitherOptionalFilledKind.setTo(right("optional", value)));
|
|
12
12
|
}
|
|
13
13
|
function isOptionalFilled(input) {
|
|
14
14
|
return isRight(input)
|
|
@@ -5,8 +5,8 @@ import { type Future } from "../future";
|
|
|
5
5
|
import { type EitherSuccess } from "./success";
|
|
6
6
|
import { type AnyValue, type Unwrap } from "../../common";
|
|
7
7
|
type Either = EitherRight | EitherLeft;
|
|
8
|
-
export type EitherRightAsyncPipeFunction<GenericInput extends AnyValue = AnyValue, GenericOutput extends MaybeFutureEither<AnyValue> = MaybeFutureEither<AnyValue>> = (input: Awaited<GenericInput> extends infer InferredInput extends Either ? Unwrap<Exclude<
|
|
9
|
-
export type EitherRightAsyncPipeResult<GenericPipeOutputs extends AnyValue, GenericLastPipeOutput extends AnyValue> = Extract<Awaited<GenericPipeOutputs>, EitherLeft> |
|
|
8
|
+
export type EitherRightAsyncPipeFunction<GenericInput extends AnyValue = AnyValue, GenericOutput extends MaybeFutureEither<AnyValue> = MaybeFutureEither<AnyValue>> = (input: Awaited<GenericInput> extends infer InferredInput ? InferredInput extends Either ? Unwrap<Exclude<InferredInput, EitherLeft>> : InferredInput : never) => GenericOutput;
|
|
9
|
+
export type EitherRightAsyncPipeResult<GenericPipeOutputs extends AnyValue, GenericLastPipeOutput extends AnyValue> = Extract<Awaited<GenericPipeOutputs>, EitherLeft> | (Awaited<GenericLastPipeOutput> extends infer InferredLastResult ? Exclude<InferredLastResult extends Either ? InferredLastResult : EitherSuccess<InferredLastResult>, EitherLeft> : never);
|
|
10
10
|
export declare function rightAsyncPipe<GenericInput extends MaybeFutureEither<AnyValue>, GenericOutputPipe1 extends MaybeFutureEither<AnyValue>>(input: GenericInput, pipe1: EitherRightAsyncPipeFunction<GenericInput, GenericOutputPipe1>): Future<Extract<EitherRightAsyncPipeResult<GenericInput | GenericOutputPipe1, GenericOutputPipe1>, any>>;
|
|
11
11
|
export declare function rightAsyncPipe<GenericInput extends MaybeFutureEither<AnyValue>, GenericOutputPipe1 extends MaybeFutureEither<AnyValue>, GenericOutputPipe2 extends MaybeFutureEither<AnyValue>>(input: GenericInput, pipe1: EitherRightAsyncPipeFunction<GenericInput, GenericOutputPipe1>, pipe2: EitherRightAsyncPipeFunction<GenericOutputPipe1, GenericOutputPipe2>): Future<Extract<EitherRightAsyncPipeResult<GenericInput | GenericOutputPipe1 | GenericOutputPipe2, GenericOutputPipe2>, any>>;
|
|
12
12
|
export declare function rightAsyncPipe<GenericInput extends MaybeFutureEither<AnyValue>, GenericOutputPipe1 extends MaybeFutureEither<AnyValue>, GenericOutputPipe2 extends MaybeFutureEither<AnyValue>, GenericOutputPipe3 extends MaybeFutureEither<AnyValue>>(input: GenericInput, pipe1: EitherRightAsyncPipeFunction<GenericInput, GenericOutputPipe1>, pipe2: EitherRightAsyncPipeFunction<GenericOutputPipe1, GenericOutputPipe2>, pipe3: EitherRightAsyncPipeFunction<GenericOutputPipe2, GenericOutputPipe3>): Future<Extract<EitherRightAsyncPipeResult<GenericInput | GenericOutputPipe1 | GenericOutputPipe2 | GenericOutputPipe3, GenericOutputPipe3>, any>>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var kind = require('../../common/kind.cjs');
|
|
4
3
|
var wrapValue = require('../../common/wrapValue.cjs');
|
|
5
|
-
var
|
|
4
|
+
var kind = require('../kind.cjs');
|
|
6
5
|
|
|
7
|
-
const eitherRightKind = kind.
|
|
6
|
+
const eitherRightKind = kind.createEitherKind("right");
|
|
8
7
|
function right(information, value = undefined) {
|
|
9
|
-
return eitherRightKind.
|
|
8
|
+
return eitherRightKind.setTo(kind.eitherInformationKind.setTo(wrapValue.wrapValue(value), information));
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
exports.eitherRightKind = eitherRightKind;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Kind } from "../../common/kind";
|
|
2
2
|
import { type WrappedValue } from "../../common/wrapValue";
|
|
3
|
-
import { eitherInformationKind } from "../
|
|
4
|
-
export declare const eitherRightKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"
|
|
3
|
+
import { eitherInformationKind } from "../kind";
|
|
4
|
+
export declare const eitherRightKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/right", unknown>>;
|
|
5
5
|
type _EitherRight<GenericInformation extends string = string, GenericValue extends unknown = unknown> = (Kind<typeof eitherRightKind.definition> & Kind<typeof eitherInformationKind.definition, GenericInformation> & WrappedValue<GenericValue>);
|
|
6
6
|
export interface EitherRight<GenericInformation extends string = string, GenericValue extends unknown = unknown> extends _EitherRight<GenericInformation, GenericValue> {
|
|
7
7
|
}
|