@duplojs/utils 1.1.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/common/kind.cjs +7 -0
- package/dist/common/kind.d.ts +4 -2
- package/dist/common/kind.mjs +7 -1
- package/dist/dataParser/base.cjs +3 -3
- package/dist/dataParser/base.d.ts +2 -2
- package/dist/dataParser/base.mjs +3 -3
- package/dist/dataParser/baseExtended.cjs +2 -2
- package/dist/dataParser/baseExtended.d.ts +1 -1
- package/dist/dataParser/baseExtended.mjs +2 -2
- package/dist/dataParser/error.cjs +4 -4
- package/dist/dataParser/error.d.ts +3 -3
- package/dist/dataParser/error.mjs +4 -4
- 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/max.cjs +2 -2
- package/dist/dataParser/parsers/array/checkers/max.d.ts +1 -1
- package/dist/dataParser/parsers/array/checkers/max.mjs +2 -2
- package/dist/dataParser/parsers/array/checkers/min.cjs +2 -2
- package/dist/dataParser/parsers/array/checkers/min.d.ts +1 -1
- package/dist/dataParser/parsers/array/checkers/min.mjs +2 -2
- package/dist/dataParser/parsers/array/index.cjs +2 -2
- package/dist/dataParser/parsers/array/index.d.ts +1 -1
- package/dist/dataParser/parsers/array/index.mjs +2 -2
- package/dist/dataParser/parsers/bigint/checkers/max.cjs +2 -2
- package/dist/dataParser/parsers/bigint/checkers/max.d.ts +1 -1
- package/dist/dataParser/parsers/bigint/checkers/max.mjs +2 -2
- package/dist/dataParser/parsers/bigint/checkers/min.cjs +2 -2
- package/dist/dataParser/parsers/bigint/checkers/min.d.ts +1 -1
- package/dist/dataParser/parsers/bigint/checkers/min.mjs +2 -2
- package/dist/dataParser/parsers/bigint/index.cjs +2 -2
- package/dist/dataParser/parsers/bigint/index.d.ts +1 -1
- package/dist/dataParser/parsers/bigint/index.mjs +2 -2
- package/dist/dataParser/parsers/boolean.cjs +2 -2
- package/dist/dataParser/parsers/boolean.d.ts +1 -1
- package/dist/dataParser/parsers/boolean.mjs +2 -2
- package/dist/dataParser/parsers/empty.cjs +2 -2
- package/dist/dataParser/parsers/empty.d.ts +1 -1
- package/dist/dataParser/parsers/empty.mjs +2 -2
- package/dist/dataParser/parsers/lazy.cjs +2 -2
- package/dist/dataParser/parsers/lazy.d.ts +1 -1
- package/dist/dataParser/parsers/lazy.mjs +2 -2
- package/dist/dataParser/parsers/literal.cjs +3 -3
- package/dist/dataParser/parsers/literal.d.ts +1 -1
- package/dist/dataParser/parsers/literal.mjs +3 -3
- package/dist/dataParser/parsers/nil.cjs +2 -2
- package/dist/dataParser/parsers/nil.d.ts +1 -1
- package/dist/dataParser/parsers/nil.mjs +2 -2
- package/dist/dataParser/parsers/nullable.cjs +2 -2
- package/dist/dataParser/parsers/nullable.d.ts +1 -1
- package/dist/dataParser/parsers/nullable.mjs +2 -2
- package/dist/dataParser/parsers/number/checkers/int.cjs +2 -2
- package/dist/dataParser/parsers/number/checkers/int.d.ts +1 -1
- package/dist/dataParser/parsers/number/checkers/int.mjs +2 -2
- package/dist/dataParser/parsers/number/checkers/max.cjs +2 -2
- package/dist/dataParser/parsers/number/checkers/max.d.ts +1 -1
- package/dist/dataParser/parsers/number/checkers/max.mjs +2 -2
- package/dist/dataParser/parsers/number/checkers/min.cjs +2 -2
- package/dist/dataParser/parsers/number/checkers/min.d.ts +1 -1
- package/dist/dataParser/parsers/number/checkers/min.mjs +2 -2
- package/dist/dataParser/parsers/number/index.cjs +2 -2
- package/dist/dataParser/parsers/number/index.d.ts +1 -1
- package/dist/dataParser/parsers/number/index.mjs +2 -2
- package/dist/dataParser/parsers/object.cjs +2 -2
- package/dist/dataParser/parsers/object.d.ts +1 -1
- package/dist/dataParser/parsers/object.mjs +2 -2
- package/dist/dataParser/parsers/optional.cjs +2 -2
- package/dist/dataParser/parsers/optional.d.ts +1 -1
- package/dist/dataParser/parsers/optional.mjs +2 -2
- package/dist/dataParser/parsers/pipe.cjs +2 -2
- package/dist/dataParser/parsers/pipe.d.ts +1 -1
- package/dist/dataParser/parsers/pipe.mjs +2 -2
- package/dist/dataParser/parsers/record.cjs +2 -2
- package/dist/dataParser/parsers/record.d.ts +1 -1
- package/dist/dataParser/parsers/record.mjs +2 -2
- package/dist/dataParser/parsers/string/checkers/email.cjs +2 -2
- package/dist/dataParser/parsers/string/checkers/email.d.ts +1 -1
- package/dist/dataParser/parsers/string/checkers/email.mjs +2 -2
- package/dist/dataParser/parsers/string/checkers/max.cjs +2 -2
- package/dist/dataParser/parsers/string/checkers/max.d.ts +1 -1
- package/dist/dataParser/parsers/string/checkers/max.mjs +2 -2
- package/dist/dataParser/parsers/string/checkers/min.cjs +2 -2
- package/dist/dataParser/parsers/string/checkers/min.d.ts +1 -1
- package/dist/dataParser/parsers/string/checkers/min.mjs +2 -2
- package/dist/dataParser/parsers/string/checkers/regex.cjs +2 -2
- package/dist/dataParser/parsers/string/checkers/regex.d.ts +1 -1
- package/dist/dataParser/parsers/string/checkers/regex.mjs +2 -2
- package/dist/dataParser/parsers/string/checkers/url.cjs +2 -2
- package/dist/dataParser/parsers/string/checkers/url.d.ts +1 -1
- package/dist/dataParser/parsers/string/checkers/url.mjs +2 -2
- package/dist/dataParser/parsers/string/index.cjs +2 -2
- package/dist/dataParser/parsers/string/index.d.ts +1 -1
- package/dist/dataParser/parsers/string/index.mjs +2 -2
- package/dist/dataParser/parsers/templateLiteral.cjs +2 -2
- package/dist/dataParser/parsers/templateLiteral.d.ts +1 -1
- package/dist/dataParser/parsers/templateLiteral.mjs +2 -2
- package/dist/dataParser/parsers/transform.cjs +2 -2
- package/dist/dataParser/parsers/transform.d.ts +1 -1
- package/dist/dataParser/parsers/transform.mjs +2 -2
- package/dist/dataParser/parsers/tuple.cjs +2 -2
- package/dist/dataParser/parsers/tuple.d.ts +1 -1
- package/dist/dataParser/parsers/tuple.mjs +2 -2
- package/dist/dataParser/parsers/union.cjs +2 -2
- package/dist/dataParser/parsers/union.d.ts +1 -1
- package/dist/dataParser/parsers/union.mjs +2 -2
- package/dist/dataParser/parsers/unknown.cjs +2 -2
- package/dist/dataParser/parsers/unknown.d.ts +1 -1
- package/dist/dataParser/parsers/unknown.mjs +2 -2
- 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 +4 -4
- package/dist/either/bool/falsy.d.ts +4 -4
- package/dist/either/bool/falsy.mjs +4 -4
- package/dist/either/bool/truthy.cjs +3 -3
- package/dist/either/bool/truthy.d.ts +5 -5
- package/dist/either/bool/truthy.mjs +3 -3
- 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 +2 -2
- package/dist/either/future/error.d.ts +1 -1
- package/dist/either/future/error.mjs +2 -2
- package/dist/either/future/success.cjs +2 -2
- package/dist/either/future/success.d.ts +2 -2
- package/dist/either/future/success.mjs +2 -2
- 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 +2 -3
- package/dist/either/left/error.cjs +2 -2
- package/dist/either/left/error.d.ts +1 -1
- package/dist/either/left/error.mjs +2 -2
- package/dist/either/left/fail.cjs +2 -2
- package/dist/either/left/fail.d.ts +1 -1
- package/dist/either/left/fail.mjs +2 -2
- 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 +2 -2
- package/dist/either/nullable/empty.d.ts +1 -1
- package/dist/either/nullable/empty.mjs +2 -2
- package/dist/either/nullable/filled.cjs +2 -2
- package/dist/either/nullable/filled.d.ts +1 -1
- package/dist/either/nullable/filled.mjs +2 -2
- 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 +2 -2
- package/dist/either/nullish/empty.d.ts +2 -2
- package/dist/either/nullish/empty.mjs +2 -2
- package/dist/either/nullish/filled.cjs +3 -3
- package/dist/either/nullish/filled.d.ts +1 -1
- package/dist/either/nullish/filled.mjs +3 -3
- 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 +4 -4
- package/dist/either/optional/empty.d.ts +3 -3
- package/dist/either/optional/empty.mjs +4 -4
- package/dist/either/optional/filled.cjs +4 -4
- package/dist/either/optional/filled.d.ts +3 -3
- package/dist/either/optional/filled.mjs +4 -4
- package/dist/either/right/create.cjs +3 -4
- package/dist/either/right/create.d.ts +2 -2
- package/dist/either/right/create.mjs +2 -3
- package/dist/either/right/is.cjs +2 -2
- package/dist/either/right/is.mjs +1 -1
- package/dist/either/right/ok.cjs +2 -2
- package/dist/either/right/ok.d.ts +1 -1
- package/dist/either/right/ok.mjs +2 -2
- package/dist/either/right/success.cjs +2 -2
- package/dist/either/right/success.d.ts +2 -2
- package/dist/either/right/success.mjs +2 -2
- package/dist/either/whenHasInformation.cjs +2 -2
- package/dist/either/whenHasInformation.d.ts +1 -1
- package/dist/either/whenHasInformation.mjs +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +1 -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/string/types/forbiddenCharacters.d.ts +5 -0
- package/dist/string/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/either/base.cjs +0 -7
- package/dist/either/base.d.ts +0 -1
- package/dist/either/base.mjs +0 -5
|
@@ -1,9 +1,9 @@
|
|
|
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
8
|
return eitherErrorKind.setTo(create.left("error", value));
|
|
9
9
|
}
|
|
@@ -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,7 +1,7 @@
|
|
|
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
6
|
return eitherErrorKind.setTo(left("error", value));
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
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
8
|
return eitherFailKind.setTo(create.left("fail", undefined));
|
|
9
9
|
}
|
|
@@ -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,7 +1,7 @@
|
|
|
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
6
|
return eitherFailKind.setTo(left("fail", undefined));
|
|
7
7
|
}
|
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,14 +1,14 @@
|
|
|
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
13
|
return base.eitherNullableKind.setTo(eitherNullableEmptyKind.setTo(create.left("nullable", null)));
|
|
14
14
|
}
|
|
@@ -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,12 +1,12 @@
|
|
|
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
11
|
return eitherNullableKind.setTo(eitherNullableEmptyKind.setTo(left("nullable", null)));
|
|
12
12
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
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
13
|
return base.eitherNullableKind.setTo(eitherNullableFilledKind.setTo(create.right("nullable", value)));
|
|
14
14
|
}
|
|
@@ -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,12 +1,12 @@
|
|
|
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
11
|
return eitherNullableKind.setTo(eitherNullableFilledKind.setTo(right("nullable", value)));
|
|
12
12
|
}
|
|
@@ -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,14 +1,14 @@
|
|
|
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
13
|
return base.eitherNullishKind.setTo(eitherNullishEmptyKind.setTo(create.left("nullish", value)));
|
|
14
14
|
}
|
|
@@ -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,12 +1,12 @@
|
|
|
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
11
|
return eitherNullishKind.setTo(eitherNullishEmptyKind.setTo(left("nullish", value)));
|
|
12
12
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
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
13
|
return base.eitherNullishKind.setTo(eitherNullishFilledKind.setTo(create.right("nullish", value)));
|
|
14
14
|
}
|
|
@@ -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,12 +1,12 @@
|
|
|
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
11
|
return eitherNullishKind.setTo(eitherNullishFilledKind.setTo(right("nullish", value)));
|
|
12
12
|
}
|
|
@@ -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,13 +1,13 @@
|
|
|
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
12
|
return base.eitherOptionalKind.setTo(eitherOptionalEmptyKind.setTo(create.left("optional", undefined)));
|
|
13
13
|
}
|
|
@@ -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,11 +1,11 @@
|
|
|
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
10
|
return eitherOptionalKind.setTo(eitherOptionalEmptyKind.setTo(left("optional", undefined)));
|
|
11
11
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
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
13
|
return base.eitherOptionalKind.setTo(eitherOptionalFilledKind.setTo(create.right("optional", value)));
|
|
14
14
|
}
|
|
@@ -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,12 +1,12 @@
|
|
|
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
11
|
return eitherOptionalKind.setTo(eitherOptionalFilledKind.setTo(right("optional", value)));
|
|
12
12
|
}
|
|
@@ -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.setTo(
|
|
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
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
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 eitherRightKind =
|
|
4
|
+
const eitherRightKind = createEitherKind("right");
|
|
6
5
|
function right(information, value = undefined) {
|
|
7
6
|
return eitherRightKind.setTo(eitherInformationKind.setTo(wrapValue(value), information));
|
|
8
7
|
}
|
package/dist/either/right/is.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var kind = require('../kind.cjs');
|
|
4
4
|
var create = require('./create.cjs');
|
|
5
5
|
var wrapValue = require('../../common/wrapValue.cjs');
|
|
6
6
|
|
|
7
7
|
function isRight(input) {
|
|
8
8
|
return create.eitherRightKind.has(input)
|
|
9
|
-
&&
|
|
9
|
+
&& kind.eitherInformationKind.has(input)
|
|
10
10
|
&& wrapValue.isWrappedValue(input);
|
|
11
11
|
}
|
|
12
12
|
|
package/dist/either/right/is.mjs
CHANGED
package/dist/either/right/ok.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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 eitherOkKind = kind.
|
|
6
|
+
const eitherOkKind = kind.createEitherKind("ok");
|
|
7
7
|
function ok() {
|
|
8
8
|
return eitherOkKind.setTo(create.right("ok", undefined));
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Kind } from "../../common/kind";
|
|
2
2
|
import { type EitherRight } from "./create";
|
|
3
|
-
export declare const eitherOkKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"
|
|
3
|
+
export declare const eitherOkKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/ok", unknown>>;
|
|
4
4
|
type _EitherOk = (EitherRight<"ok", never> & Kind<typeof eitherOkKind.definition>);
|
|
5
5
|
export interface EitherOk extends _EitherOk {
|
|
6
6
|
}
|
package/dist/either/right/ok.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createEitherKind } from '../kind.mjs';
|
|
2
2
|
import { right } from './create.mjs';
|
|
3
3
|
|
|
4
|
-
const eitherOkKind =
|
|
4
|
+
const eitherOkKind = createEitherKind("ok");
|
|
5
5
|
function ok() {
|
|
6
6
|
return eitherOkKind.setTo(right("ok", undefined));
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var kind = require('../kind.cjs');
|
|
3
4
|
var create = require('./create.cjs');
|
|
4
|
-
var kind = require('../../common/kind.cjs');
|
|
5
5
|
|
|
6
|
-
const eitherSuccessKind = kind.
|
|
6
|
+
const eitherSuccessKind = kind.createEitherKind("success");
|
|
7
7
|
function success(value) {
|
|
8
8
|
return eitherSuccessKind.setTo(create.right("success", value));
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type EitherRight } from "./create";
|
|
2
1
|
import { type Kind } from "../../common/kind";
|
|
3
|
-
|
|
2
|
+
import { type EitherRight } from "./create";
|
|
3
|
+
export declare const eitherSuccessKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/success", unknown>>;
|
|
4
4
|
type _EitherSuccess<GenericValue extends unknown = unknown> = (EitherRight<"success", GenericValue> & Kind<typeof eitherSuccessKind.definition>);
|
|
5
5
|
export interface EitherSuccess<GenericValue extends unknown = unknown> extends _EitherSuccess<GenericValue> {
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { createEitherKind } from '../kind.mjs';
|
|
1
2
|
import { right } from './create.mjs';
|
|
2
|
-
import { createKind } from '../../common/kind.mjs';
|
|
3
3
|
|
|
4
|
-
const eitherSuccessKind =
|
|
4
|
+
const eitherSuccessKind = createEitherKind("success");
|
|
5
5
|
function success(value) {
|
|
6
6
|
return eitherSuccessKind.setTo(right("success", value));
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var unwrap = require('../common/unwrap.cjs');
|
|
4
|
-
var
|
|
4
|
+
var kind = require('./kind.cjs');
|
|
5
5
|
var is = require('./left/is.cjs');
|
|
6
6
|
var is$1 = require('./right/is.cjs');
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ function whenHasInformation(...args) {
|
|
|
15
15
|
? information
|
|
16
16
|
: [information];
|
|
17
17
|
if ((is.isLeft(input)
|
|
18
|
-
|| is$1.isRight(input)) && formattedInformation.includes(
|
|
18
|
+
|| is$1.isRight(input)) && formattedInformation.includes(kind.eitherInformationKind.getValue(input))) {
|
|
19
19
|
return theFunction(unwrap.unwrap(input));
|
|
20
20
|
}
|
|
21
21
|
return input;
|