@duplojs/utils 1.1.7 → 1.1.9
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/reduce.cjs +1 -0
- package/dist/array/reduce.mjs +1 -0
- package/dist/array/reduceRight.cjs +1 -0
- package/dist/array/reduceRight.mjs +1 -0
- package/dist/common/globalStore.cjs +21 -0
- package/dist/common/globalStore.d.ts +7 -0
- package/dist/common/globalStore.mjs +19 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/instanceOf.cjs +1 -0
- package/dist/common/instanceOf.mjs +1 -0
- package/dist/common/kind.cjs +12 -3
- package/dist/common/kind.d.ts +12 -3
- package/dist/common/kind.mjs +11 -4
- package/dist/common/wrapValue.cjs +4 -0
- package/dist/common/wrapValue.d.ts +1 -0
- package/dist/common/wrapValue.mjs +4 -1
- package/dist/dataParser/base.cjs +4 -3
- package/dist/dataParser/base.d.ts +2 -2
- package/dist/dataParser/base.mjs +4 -3
- package/dist/dataParser/baseExtended.cjs +3 -2
- package/dist/dataParser/baseExtended.d.ts +1 -1
- package/dist/dataParser/baseExtended.mjs +3 -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/extended/array.cjs +1 -0
- package/dist/dataParser/extended/array.mjs +1 -0
- package/dist/dataParser/extended/bigint.cjs +1 -0
- package/dist/dataParser/extended/bigint.mjs +1 -0
- package/dist/dataParser/extended/boolean.cjs +1 -0
- package/dist/dataParser/extended/boolean.mjs +1 -0
- package/dist/dataParser/extended/coerce/bigint.cjs +1 -0
- package/dist/dataParser/extended/coerce/bigint.mjs +1 -0
- package/dist/dataParser/extended/coerce/boolean.cjs +1 -0
- package/dist/dataParser/extended/coerce/boolean.mjs +1 -0
- package/dist/dataParser/extended/coerce/empty.cjs +1 -0
- package/dist/dataParser/extended/coerce/empty.mjs +1 -0
- package/dist/dataParser/extended/coerce/nil.cjs +1 -0
- package/dist/dataParser/extended/coerce/nil.mjs +1 -0
- package/dist/dataParser/extended/coerce/number.cjs +1 -0
- package/dist/dataParser/extended/coerce/number.mjs +1 -0
- package/dist/dataParser/extended/coerce/string.cjs +1 -0
- package/dist/dataParser/extended/coerce/string.mjs +1 -0
- package/dist/dataParser/extended/empty.cjs +1 -0
- package/dist/dataParser/extended/empty.mjs +1 -0
- package/dist/dataParser/extended/lazy.cjs +1 -0
- package/dist/dataParser/extended/lazy.mjs +1 -0
- package/dist/dataParser/extended/literal.cjs +1 -0
- package/dist/dataParser/extended/literal.mjs +1 -0
- package/dist/dataParser/extended/nil.cjs +1 -0
- package/dist/dataParser/extended/nil.mjs +1 -0
- package/dist/dataParser/extended/nullable.cjs +1 -0
- package/dist/dataParser/extended/nullable.mjs +1 -0
- package/dist/dataParser/extended/number.cjs +1 -0
- package/dist/dataParser/extended/number.mjs +1 -0
- package/dist/dataParser/extended/object.cjs +1 -0
- package/dist/dataParser/extended/object.mjs +1 -0
- package/dist/dataParser/extended/optional.cjs +1 -0
- package/dist/dataParser/extended/optional.mjs +1 -0
- package/dist/dataParser/extended/pipe.cjs +1 -0
- package/dist/dataParser/extended/pipe.mjs +1 -0
- package/dist/dataParser/extended/record.cjs +1 -0
- package/dist/dataParser/extended/record.mjs +1 -0
- package/dist/dataParser/extended/string.cjs +1 -0
- package/dist/dataParser/extended/string.mjs +1 -0
- package/dist/dataParser/extended/templateLiteral.cjs +1 -0
- package/dist/dataParser/extended/templateLiteral.mjs +1 -0
- package/dist/dataParser/extended/transform.cjs +1 -0
- package/dist/dataParser/extended/transform.mjs +1 -0
- package/dist/dataParser/extended/tuple.cjs +1 -0
- package/dist/dataParser/extended/tuple.mjs +1 -0
- package/dist/dataParser/extended/union.cjs +1 -0
- package/dist/dataParser/extended/union.mjs +1 -0
- package/dist/dataParser/extended/unknown.cjs +1 -0
- package/dist/dataParser/extended/unknown.mjs +1 -0
- package/dist/dataParser/kind.cjs +10 -0
- package/dist/dataParser/kind.d.ts +1 -0
- package/dist/dataParser/kind.mjs +8 -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/coerce/bigint.cjs +1 -0
- package/dist/dataParser/parsers/coerce/bigint.mjs +1 -0
- package/dist/dataParser/parsers/coerce/boolean.cjs +1 -0
- package/dist/dataParser/parsers/coerce/boolean.mjs +1 -0
- package/dist/dataParser/parsers/coerce/empty.cjs +1 -0
- package/dist/dataParser/parsers/coerce/empty.mjs +1 -0
- package/dist/dataParser/parsers/coerce/nil.cjs +1 -0
- package/dist/dataParser/parsers/coerce/nil.mjs +1 -0
- package/dist/dataParser/parsers/coerce/number.cjs +1 -0
- package/dist/dataParser/parsers/coerce/number.mjs +1 -0
- package/dist/dataParser/parsers/coerce/string.cjs +1 -0
- package/dist/dataParser/parsers/coerce/string.mjs +1 -0
- 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 +4 -3
- package/dist/dataParser/parsers/literal.d.ts +1 -1
- package/dist/dataParser/parsers/literal.mjs +4 -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 +3 -2
- package/dist/dataParser/parsers/object.d.ts +1 -1
- package/dist/dataParser/parsers/object.mjs +3 -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 +3 -2
- package/dist/dataParser/parsers/templateLiteral.d.ts +1 -1
- package/dist/dataParser/parsers/templateLiteral.mjs +3 -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 +5 -4
- package/dist/either/bool/falsy.d.ts +4 -4
- package/dist/either/bool/falsy.mjs +5 -4
- package/dist/either/bool/truthy.cjs +4 -3
- package/dist/either/bool/truthy.d.ts +5 -5
- package/dist/either/bool/truthy.mjs +4 -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/create.cjs +1 -0
- package/dist/either/future/create.mjs +1 -0
- package/dist/either/future/error.cjs +3 -2
- package/dist/either/future/error.d.ts +1 -1
- package/dist/either/future/error.mjs +3 -2
- package/dist/either/future/success.cjs +3 -2
- package/dist/either/future/success.d.ts +2 -2
- package/dist/either/future/success.mjs +3 -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 +12 -0
- package/dist/either/kind.d.ts +2 -0
- package/dist/either/kind.mjs +9 -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/left/when.cjs +1 -0
- package/dist/either/left/when.mjs +1 -0
- 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 -2
- package/dist/either/nullable/empty.d.ts +1 -1
- package/dist/either/nullable/empty.mjs +3 -2
- package/dist/either/nullable/filled.cjs +3 -2
- package/dist/either/nullable/filled.d.ts +1 -1
- package/dist/either/nullable/filled.mjs +3 -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 +3 -2
- package/dist/either/nullish/empty.d.ts +2 -2
- package/dist/either/nullish/empty.mjs +3 -2
- package/dist/either/nullish/filled.cjs +4 -3
- package/dist/either/nullish/filled.d.ts +1 -1
- package/dist/either/nullish/filled.mjs +4 -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 +5 -4
- package/dist/either/optional/empty.d.ts +3 -3
- package/dist/either/optional/empty.mjs +5 -4
- package/dist/either/optional/filled.cjs +5 -4
- package/dist/either/optional/filled.d.ts +3 -3
- package/dist/either/optional/filled.mjs +5 -4
- package/dist/either/right/asyncPipe.cjs +1 -0
- package/dist/either/right/asyncPipe.mjs +1 -0
- 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/pipe.cjs +1 -0
- package/dist/either/right/pipe.mjs +1 -0
- 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/right/when.cjs +1 -0
- package/dist/either/right/when.mjs +1 -0
- package/dist/either/whenHasInformation.cjs +3 -2
- package/dist/either/whenHasInformation.d.ts +1 -1
- package/dist/either/whenHasInformation.mjs +2 -1
- package/dist/generator/asyncReduce.cjs +1 -0
- package/dist/generator/asyncReduce.mjs +1 -0
- package/dist/generator/reduce.cjs +1 -0
- package/dist/generator/reduce.mjs +1 -0
- package/dist/index.cjs +5 -0
- package/dist/index.mjs +3 -2
- 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/deepDiscriminate.cjs +1 -0
- package/dist/object/deepDiscriminate.mjs +1 -0
- package/dist/object/discriminate.cjs +1 -0
- package/dist/object/discriminate.mjs +1 -0
- package/dist/object/entries.cjs +3 -1
- package/dist/object/entries.mjs +4 -2
- package/dist/object/keys.cjs +3 -1
- package/dist/object/keys.mjs +4 -2
- package/dist/pattern/exhaustive.cjs +1 -0
- package/dist/pattern/exhaustive.mjs +1 -0
- package/dist/pattern/otherwise.cjs +1 -0
- package/dist/pattern/otherwise.mjs +1 -0
- package/dist/pattern/result.cjs +1 -0
- package/dist/pattern/result.mjs +1 -0
- package/dist/string/types/forbiddenString.d.ts +8 -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,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,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var unwrap = require('../common/unwrap.cjs');
|
|
4
|
-
|
|
4
|
+
require('../common/globalStore.cjs');
|
|
5
|
+
var kind = require('./kind.cjs');
|
|
5
6
|
var is = require('./left/is.cjs');
|
|
6
7
|
var is$1 = require('./right/is.cjs');
|
|
7
8
|
|
|
@@ -15,7 +16,7 @@ function whenHasInformation(...args) {
|
|
|
15
16
|
? information
|
|
16
17
|
: [information];
|
|
17
18
|
if ((is.isLeft(input)
|
|
18
|
-
|| is$1.isRight(input)) && formattedInformation.includes(
|
|
19
|
+
|| is$1.isRight(input)) && formattedInformation.includes(kind.eitherInformationKind.getValue(input))) {
|
|
19
20
|
return theFunction(unwrap.unwrap(input));
|
|
20
21
|
}
|
|
21
22
|
return input;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Kind, type WrappedValue, type AnyValue, type Unwrap, type BreakGenericLink } from "../common";
|
|
2
2
|
import { type EitherRight } from "./right";
|
|
3
3
|
import { type EitherLeft } from "./left";
|
|
4
|
-
import { eitherInformationKind } from "./
|
|
4
|
+
import { eitherInformationKind } from "./kind";
|
|
5
5
|
type Either = EitherRight | EitherLeft;
|
|
6
6
|
export declare function whenHasInformation<const GenericInput extends unknown, GenericInformation extends (GenericInput extends Either ? ReturnType<typeof eitherInformationKind.getValue<GenericInput>> : never), const GenericOutput extends AnyValue>(information: GenericInformation | GenericInformation[], theFunction: (value: Unwrap<Extract<GenericInput, Kind<typeof eitherInformationKind.definition, GenericInformation> & WrappedValue>>) => GenericOutput): (input: GenericInput) => GenericOutput | Exclude<BreakGenericLink<GenericInput>, Kind<typeof eitherInformationKind.definition, GenericInformation>>;
|
|
7
7
|
export declare function whenHasInformation<const GenericInput extends unknown, GenericInformation extends (GenericInput extends Either ? ReturnType<typeof eitherInformationKind.getValue<GenericInput>> : never), const GenericOutput extends AnyValue>(input: GenericInput, information: GenericInformation | GenericInformation[], theFunction: (value: Unwrap<Extract<GenericInput, Kind<typeof eitherInformationKind.definition, GenericInformation> & WrappedValue>>) => GenericOutput): GenericOutput | Exclude<GenericInput, Kind<typeof eitherInformationKind.definition, GenericInformation>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { unwrap } from '../common/unwrap.mjs';
|
|
2
|
-
import
|
|
2
|
+
import '../common/globalStore.mjs';
|
|
3
|
+
import { eitherInformationKind } from './kind.mjs';
|
|
3
4
|
import { isLeft } from './left/is.mjs';
|
|
4
5
|
import { isRight } from './right/is.mjs';
|
|
5
6
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var kind = require('../common/kind.cjs');
|
|
4
4
|
var wrapValue = require('../common/wrapValue.cjs');
|
|
5
5
|
var unwrap = require('../common/unwrap.cjs');
|
|
6
|
+
require('../common/globalStore.cjs');
|
|
6
7
|
var override = require('../object/override.cjs');
|
|
7
8
|
|
|
8
9
|
const generatorReduceFromKind = kind.createKind("generator-reduce-from");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createKind } from '../common/kind.mjs';
|
|
2
2
|
import { wrapValue } from '../common/wrapValue.mjs';
|
|
3
3
|
import { unwrap } from '../common/unwrap.mjs';
|
|
4
|
+
import '../common/globalStore.mjs';
|
|
4
5
|
import { override } from '../object/override.mjs';
|
|
5
6
|
|
|
6
7
|
const generatorReduceFromKind = createKind("generator-reduce-from");
|
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,7 @@ var whenElse = require('./common/whenElse.cjs');
|
|
|
37
37
|
var justReturn = require('./common/justReturn.cjs');
|
|
38
38
|
var memo = require('./common/memo.cjs');
|
|
39
39
|
var instanceOf = require('./common/instanceOf.cjs');
|
|
40
|
+
var globalStore = require('./common/globalStore.cjs');
|
|
40
41
|
var index = require('./array/index.cjs');
|
|
41
42
|
var index$1 = require('./number/index.cjs');
|
|
42
43
|
var index$2 = require('./either/index.cjs');
|
|
@@ -58,6 +59,8 @@ exports.escapeRegExp = escapeRegExp.escapeRegExp;
|
|
|
58
59
|
exports.createExternalPromise = externalPromise.createExternalPromise;
|
|
59
60
|
exports.createInterpolation = interpolation.createInterpolation;
|
|
60
61
|
exports.createKind = kind.createKind;
|
|
62
|
+
exports.createKindNamespace = kind.createKindNamespace;
|
|
63
|
+
exports.isRuntimeKind = kind.isRuntimeKind;
|
|
61
64
|
exports.keyKindPrefix = kind.keyKindPrefix;
|
|
62
65
|
exports.kindHeritage = kind.kindHeritage;
|
|
63
66
|
exports.pipe = pipe.pipe;
|
|
@@ -75,6 +78,7 @@ exports.unwrap = unwrap.unwrap;
|
|
|
75
78
|
exports.asyncLoop = asyncLoop.asyncLoop;
|
|
76
79
|
exports.createAsyncRetry = asyncRetry.createAsyncRetry;
|
|
77
80
|
exports.useAsyncRetry = asyncRetry.useAsyncRetry;
|
|
81
|
+
exports.isRuntimeWrappedValueKey = wrapValue.isRuntimeWrappedValueKey;
|
|
78
82
|
exports.isWrappedValue = wrapValue.isWrappedValue;
|
|
79
83
|
exports.keyWrappedValue = wrapValue.keyWrappedValue;
|
|
80
84
|
exports.wrapValue = wrapValue.wrapValue;
|
|
@@ -94,6 +98,7 @@ exports.whenElse = whenElse.whenElse;
|
|
|
94
98
|
exports.justReturn = justReturn.justReturn;
|
|
95
99
|
exports.memo = memo.memo;
|
|
96
100
|
exports.instanceOf = instanceOf.instanceOf;
|
|
101
|
+
exports.createGlobalStore = globalStore.createGlobalStore;
|
|
97
102
|
exports.A = index;
|
|
98
103
|
exports.DArray = index;
|
|
99
104
|
exports.DNumber = index$1;
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ export { createEnum } from './common/enum.mjs';
|
|
|
5
5
|
export { escapeRegExp } from './common/escapeRegExp.mjs';
|
|
6
6
|
export { createExternalPromise } from './common/externalPromise.mjs';
|
|
7
7
|
export { createInterpolation } from './common/interpolation.mjs';
|
|
8
|
-
export { createKind, keyKindPrefix, kindHeritage } from './common/kind.mjs';
|
|
8
|
+
export { createKind, createKindNamespace, isRuntimeKind, keyKindPrefix, kindHeritage } from './common/kind.mjs';
|
|
9
9
|
export { pipe } from './common/pipe.mjs';
|
|
10
10
|
export { promiseObject } from './common/promiseObject.mjs';
|
|
11
11
|
export { simpleClone } from './common/simpleClone.mjs';
|
|
@@ -18,7 +18,7 @@ export { toWrappedValue } from './common/toWrappedValue.mjs';
|
|
|
18
18
|
export { unwrap } from './common/unwrap.mjs';
|
|
19
19
|
export { asyncLoop } from './common/asyncLoop.mjs';
|
|
20
20
|
export { createAsyncRetry, useAsyncRetry } from './common/asyncRetry.mjs';
|
|
21
|
-
export { isWrappedValue, keyWrappedValue, wrapValue } from './common/wrapValue.mjs';
|
|
21
|
+
export { isRuntimeWrappedValueKey, isWrappedValue, keyWrappedValue, wrapValue } from './common/wrapValue.mjs';
|
|
22
22
|
export { toString } from './common/toString.mjs';
|
|
23
23
|
export { innerPipe } from './common/innerPipe.mjs';
|
|
24
24
|
export { asyncInnerPipe } from './common/asyncInnerPipe.mjs';
|
|
@@ -35,6 +35,7 @@ export { whenElse } from './common/whenElse.mjs';
|
|
|
35
35
|
export { justReturn } from './common/justReturn.mjs';
|
|
36
36
|
export { memo } from './common/memo.mjs';
|
|
37
37
|
export { instanceOf } from './common/instanceOf.mjs';
|
|
38
|
+
export { createGlobalStore } from './common/globalStore.mjs';
|
|
38
39
|
import * as index from './array/index.mjs';
|
|
39
40
|
export { index as A };
|
|
40
41
|
export { index as DArray };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function greaterThan(...args) {
|
|
4
|
+
if (args.length === 1) {
|
|
5
|
+
const [threshold] = args;
|
|
6
|
+
return (value) => greaterThan(value, threshold);
|
|
7
|
+
}
|
|
8
|
+
const [value, threshold] = args;
|
|
9
|
+
return value > threshold;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.greaterThan = greaterThan;
|
package/dist/number/index.cjs
CHANGED
|
@@ -22,6 +22,10 @@ var sin = require('./sin.cjs');
|
|
|
22
22
|
var subtract = require('./subtract.cjs');
|
|
23
23
|
var tan = require('./tan.cjs');
|
|
24
24
|
var trunc = require('./trunc.cjs');
|
|
25
|
+
var greater = require('./greater.cjs');
|
|
26
|
+
var less = require('./less.cjs');
|
|
27
|
+
var greaterThan = require('./greaterThan.cjs');
|
|
28
|
+
var lessThan = require('./lessThan.cjs');
|
|
25
29
|
|
|
26
30
|
|
|
27
31
|
|
|
@@ -47,3 +51,7 @@ exports.sin = sin.sin;
|
|
|
47
51
|
exports.subtract = subtract.subtract;
|
|
48
52
|
exports.tan = tan.tan;
|
|
49
53
|
exports.trunc = trunc.trunc;
|
|
54
|
+
exports.greater = greater.greater;
|
|
55
|
+
exports.less = less.less;
|
|
56
|
+
exports.greaterThan = greaterThan.greaterThan;
|
|
57
|
+
exports.lessThan = lessThan.lessThan;
|
package/dist/number/index.d.ts
CHANGED
package/dist/number/index.mjs
CHANGED
|
@@ -20,3 +20,7 @@ export { sin } from './sin.mjs';
|
|
|
20
20
|
export { subtract } from './subtract.mjs';
|
|
21
21
|
export { tan } from './tan.mjs';
|
|
22
22
|
export { trunc } from './trunc.mjs';
|
|
23
|
+
export { greater } from './greater.mjs';
|
|
24
|
+
export { less } from './less.mjs';
|
|
25
|
+
export { greaterThan } from './greaterThan.mjs';
|
|
26
|
+
export { lessThan } from './lessThan.mjs';
|
package/dist/object/entries.cjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var kind = require('../common/kind.cjs');
|
|
3
4
|
var wrapValue = require('../common/wrapValue.cjs');
|
|
5
|
+
require('../common/globalStore.cjs');
|
|
4
6
|
|
|
5
7
|
function entries(object) {
|
|
6
8
|
return Object.entries(object)
|
|
7
|
-
.filter(([key]) => !key.
|
|
9
|
+
.filter(([key]) => !wrapValue.isRuntimeWrappedValueKey(key) && !kind.isRuntimeKind(key));
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
exports.entries = entries;
|
package/dist/object/entries.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRuntimeKind } from '../common/kind.mjs';
|
|
2
|
+
import { isRuntimeWrappedValueKey } from '../common/wrapValue.mjs';
|
|
3
|
+
import '../common/globalStore.mjs';
|
|
2
4
|
|
|
3
5
|
function entries(object) {
|
|
4
6
|
return Object.entries(object)
|
|
5
|
-
.filter(([key]) => !key
|
|
7
|
+
.filter(([key]) => !isRuntimeWrappedValueKey(key) && !isRuntimeKind(key));
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
export { entries };
|
package/dist/object/keys.cjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var kind = require('../common/kind.cjs');
|
|
3
4
|
var wrapValue = require('../common/wrapValue.cjs');
|
|
5
|
+
require('../common/globalStore.cjs');
|
|
4
6
|
|
|
5
7
|
function keys(object) {
|
|
6
8
|
return Object.keys(object)
|
|
7
|
-
.filter((key) => !key.
|
|
9
|
+
.filter((key) => !wrapValue.isRuntimeWrappedValueKey(key) && !kind.isRuntimeKind(key));
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
exports.keys = keys;
|
package/dist/object/keys.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRuntimeKind } from '../common/kind.mjs';
|
|
2
|
+
import { isRuntimeWrappedValueKey } from '../common/wrapValue.mjs';
|
|
3
|
+
import '../common/globalStore.mjs';
|
|
2
4
|
|
|
3
5
|
function keys(object) {
|
|
4
6
|
return Object.keys(object)
|
|
5
|
-
.filter((key) => !key
|
|
7
|
+
.filter((key) => !isRuntimeWrappedValueKey(key) && !isRuntimeKind(key));
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
export { keys };
|
package/dist/pattern/result.cjs
CHANGED
package/dist/pattern/result.mjs
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IsEqual } from "../../common";
|
|
2
|
+
import { type Includes } from "../../string";
|
|
3
|
+
declare const SymbolErrorForbiddenString: unique symbol;
|
|
4
|
+
type SymbolErrorForbiddenString = typeof SymbolErrorForbiddenString;
|
|
5
|
+
export type ForbiddenString<GenericValue extends string, GenericCharacters extends string> = IsEqual<(GenericCharacters extends string ? Includes<GenericValue, GenericCharacters> : never) | false, boolean> extends true ? {
|
|
6
|
+
[SymbolErrorForbiddenString]: `String "${GenericCharacters}" is forbidden in value.`;
|
|
7
|
+
} : GenericValue;
|
|
8
|
+
export {};
|
package/package.json
CHANGED
package/dist/either/base.cjs
DELETED
package/dist/either/base.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const eitherInformationKind: import("../common").KindHandler<import("../common").KindDefinition<"either-information", string>>;
|