@duplojs/lang 0.0.1-beta.4 → 0.0.1-beta.5
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/index.cjs +0 -3
- package/dist/array/index.d.ts +0 -1
- package/dist/array/index.mjs +1 -3
- package/dist/common/constraint/cast/number.d.ts +15 -0
- package/dist/common/constraint/cast/string.d.ts +9 -0
- package/dist/common/constraint/index.d.ts +1 -0
- package/dist/common/constraint/infer/array.d.ts +7 -0
- package/dist/{array/infer.cjs → common/constraint/infer/index.cjs} +1 -1
- package/dist/common/constraint/infer/index.d.ts +26 -0
- package/dist/{string/infer.mjs → common/constraint/infer/index.mjs} +1 -1
- package/dist/common/constraint/infer/number.d.ts +11 -0
- package/dist/common/constraint/infer/string.d.ts +10 -0
- package/dist/common/index.cjs +3 -0
- package/dist/common/index.mjs +3 -1
- package/dist/dataStructure/constraint/defaults/absolutePath.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/absolutePath.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/absolutePath.mjs +12 -0
- package/dist/dataStructure/constraint/defaults/index.d.ts +2 -0
- package/dist/dataStructure/constraint/defaults/path.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/path.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/path.mjs +12 -0
- package/dist/dataStructure/constraint/types/constraints.d.ts +2 -0
- package/dist/dataStructure/helpers/absolutePath.cjs +7 -0
- package/dist/dataStructure/helpers/absolutePath.d.ts +2 -0
- package/dist/dataStructure/helpers/absolutePath.mjs +7 -0
- package/dist/dataStructure/helpers/index.d.ts +2 -0
- package/dist/dataStructure/helpers/path.cjs +7 -0
- package/dist/dataStructure/helpers/path.d.ts +2 -0
- package/dist/dataStructure/helpers/path.mjs +7 -0
- package/dist/dataStructure/index.cjs +16 -0
- package/dist/dataStructure/index.mjs +11 -1
- package/dist/index.cjs +41 -39
- package/dist/index.mjs +3 -2
- package/dist/number/index.cjs +0 -3
- package/dist/number/index.d.ts +0 -1
- package/dist/number/index.mjs +1 -3
- package/dist/path/computeRelative.cjs +5 -6
- package/dist/path/computeRelative.d.ts +1 -1
- package/dist/path/computeRelative.mjs +5 -6
- package/dist/path/constraints/absolute.d.ts +1 -1
- package/dist/path/getBaseName.cjs +5 -7
- package/dist/path/getBaseName.d.ts +2 -2
- package/dist/path/getBaseName.mjs +5 -7
- package/dist/path/getExtensionName.cjs +7 -4
- package/dist/path/getExtensionName.d.ts +2 -2
- package/dist/path/getExtensionName.mjs +7 -4
- package/dist/path/getParentFolderPath.cjs +5 -4
- package/dist/path/getParentFolderPath.d.ts +1 -2
- package/dist/path/getParentFolderPath.mjs +5 -4
- package/dist/path/index.cjs +3 -3
- package/dist/path/index.d.ts +2 -2
- package/dist/path/index.mjs +3 -3
- package/dist/path/is.cjs +9 -4
- package/dist/path/is.d.ts +4 -2
- package/dist/path/is.mjs +9 -4
- package/dist/path/isAbsolute.cjs +3 -5
- package/dist/path/isAbsolute.d.ts +4 -2
- package/dist/path/isAbsolute.mjs +3 -5
- package/dist/path/normalize.cjs +18 -0
- package/dist/path/normalize.d.ts +2 -0
- package/dist/path/normalize.mjs +18 -0
- package/dist/path/resolveFrom.cjs +4 -5
- package/dist/path/resolveFrom.d.ts +9 -1
- package/dist/path/resolveFrom.mjs +4 -5
- package/dist/path/resolveRelative.cjs +17 -20
- package/dist/path/resolveRelative.d.ts +9 -2
- package/dist/path/resolveRelative.mjs +17 -20
- package/dist/path/types/index.d.ts +4 -0
- package/dist/path/types/isLiteralAbsolutePath.d.ts +2 -0
- package/dist/path/types/isLiteralPath.d.ts +20 -0
- package/dist/path/types/requireLiteralAbsolutePath.d.ts +3 -0
- package/dist/path/types/requireLiteralPath.d.ts +3 -0
- package/dist/string/index.cjs +0 -3
- package/dist/string/index.d.ts +0 -1
- package/dist/string/index.mjs +1 -3
- package/dist/string/types/split.d.ts +1 -1
- package/package.json +1 -1
- package/dist/array/infer.d.ts +0 -14
- package/dist/array/infer.mjs +0 -6
- package/dist/number/infer.cjs +0 -6
- package/dist/number/infer.d.ts +0 -12
- package/dist/number/infer.mjs +0 -6
- package/dist/path/fix.cjs +0 -8
- package/dist/path/fix.d.ts +0 -1
- package/dist/path/fix.mjs +0 -8
- package/dist/string/infer.cjs +0 -6
- package/dist/string/infer.d.ts +0 -12
package/dist/array/index.cjs
CHANGED
|
@@ -43,7 +43,6 @@ const require_shift = require("./shift.cjs");
|
|
|
43
43
|
const require_unshift = require("./unshift.cjs");
|
|
44
44
|
const require_insert$2 = require("./insert.cjs");
|
|
45
45
|
const require_reverse = require("./reverse.cjs");
|
|
46
|
-
const require_infer = require("./infer.cjs");
|
|
47
46
|
const require_notIncludes = require("./notIncludes.cjs");
|
|
48
47
|
const require_findLast = require("./findLast.cjs");
|
|
49
48
|
const require_findLastIndex = require("./findLastIndex.cjs");
|
|
@@ -82,7 +81,6 @@ var array_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
82
81
|
groupOutput: () => require_group.groupOutput,
|
|
83
82
|
includes: () => require_includes.includes,
|
|
84
83
|
indexOf: () => require_indexOf.indexOf,
|
|
85
|
-
infer: () => require_infer.infer,
|
|
86
84
|
insert: () => require_insert$2.insert,
|
|
87
85
|
is: () => require_is.is,
|
|
88
86
|
isLastIndex: () => require_isLastIndex.isLastIndex,
|
|
@@ -149,7 +147,6 @@ exports.group = require_group.group;
|
|
|
149
147
|
exports.groupOutput = require_group.groupOutput;
|
|
150
148
|
exports.includes = require_includes.includes;
|
|
151
149
|
exports.indexOf = require_indexOf.indexOf;
|
|
152
|
-
exports.infer = require_infer.infer;
|
|
153
150
|
exports.insert = require_insert$2.insert;
|
|
154
151
|
exports.is = require_is.is;
|
|
155
152
|
exports.isLastIndex = require_isLastIndex.isLastIndex;
|
package/dist/array/index.d.ts
CHANGED
package/dist/array/index.mjs
CHANGED
|
@@ -43,7 +43,6 @@ import { shift } from "./shift.mjs";
|
|
|
43
43
|
import { unshift } from "./unshift.mjs";
|
|
44
44
|
import { insert } from "./insert.mjs";
|
|
45
45
|
import { reverse } from "./reverse.mjs";
|
|
46
|
-
import { infer } from "./infer.mjs";
|
|
47
46
|
import { notIncludes } from "./notIncludes.mjs";
|
|
48
47
|
import { findLast } from "./findLast.mjs";
|
|
49
48
|
import { findLastIndex } from "./findLastIndex.mjs";
|
|
@@ -82,7 +81,6 @@ var array_exports = /* @__PURE__ */ __exportAll({
|
|
|
82
81
|
groupOutput: () => groupOutput,
|
|
83
82
|
includes: () => includes,
|
|
84
83
|
indexOf: () => indexOf,
|
|
85
|
-
infer: () => infer,
|
|
86
84
|
insert: () => insert,
|
|
87
85
|
is: () => is,
|
|
88
86
|
isLastIndex: () => isLastIndex,
|
|
@@ -116,4 +114,4 @@ var array_exports = /* @__PURE__ */ __exportAll({
|
|
|
116
114
|
unshift: () => unshift
|
|
117
115
|
});
|
|
118
116
|
//#endregion
|
|
119
|
-
export { array_exports, at, chunk, coalescing, concat, copyWithin, createKind, every, fill, fillAll, filter, find, findAndReplace, findAndSpliceDelete, findAndSpliceInsert, findAndSpliceReplace, findDuplicates, findIndex, findLast, findLastIndex, first, flat, flatMap, from, group, groupOutput, includes, indexOf,
|
|
117
|
+
export { array_exports, at, chunk, coalescing, concat, copyWithin, createKind, every, fill, fillAll, filter, find, findAndReplace, findAndSpliceDelete, findAndSpliceInsert, findAndSpliceReplace, findDuplicates, findIndex, findLast, findLastIndex, first, flat, flatMap, from, group, groupOutput, includes, indexOf, insert, is, isLastIndex, last, lastIndexOf, length, lengthEqual, map, maxElements, minElements, notIncludes, pop, prepend, push, reduce, reduceFrom, reduceKind, reduceRight, reduceTools, reverse, select, selectTools, set, shift, slice, some, sort, spliceDelete, spliceInsert, spliceReplace, unshift };
|
|
@@ -7,4 +7,19 @@ export interface ComputeCastConstraintNumberRule<GenericValue extends number, Ge
|
|
|
7
7
|
greaterThanOrEqual: GenericExpectedConstraint extends DNumber.GreaterThanOrEqual<number> ? DCommon.NeverCoalescing<(DNumber.ComputeGreaterThanOrEqualCompatibility<GenericValue, GenericExpectedConstraint, unknown> extends infer InferredResult extends CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends CompatibilityConstraintResult<true> ? unknown : DCommon.IsNever<DNumber.ExtractGreaterThanOrEqual<GenericValue>> extends true ? CastError<`Impossible to cast on GreaterThanOrEqual<${InferredResult["to"]}> because constraint GreaterThan<${InferredResult["from"]}> from the value is less than.`, GenericValue, GenericExpectedConstraint> : CastError<`Impossible to cast on GreaterThanOrEqual<${InferredResult["to"]}> because constraint GreaterThanOrEqual<${InferredResult["from"]}> from the value is less than.`, GenericValue, GenericExpectedConstraint> : never), CastError<"Impossible to cast on GreaterThanOrEqual because value does not have compatible constraint.", GenericValue, GenericExpectedConstraint>> : never;
|
|
8
8
|
lessThan: GenericExpectedConstraint extends DNumber.LessThan<number> ? DCommon.NeverCoalescing<(DNumber.ComputeLessThanCompatibility<GenericValue, GenericExpectedConstraint, unknown> extends infer InferredResult extends CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends CompatibilityConstraintResult<true> ? unknown : DCommon.IsNever<DNumber.ExtractLessThanOrEqual<GenericValue>> extends true ? CastError<`Impossible to cast on LessThan<${InferredResult["to"]}> because constraint LessThan<${InferredResult["from"]}> from the value is greater than.`, GenericValue, GenericExpectedConstraint> : CastError<`Impossible to cast on LessThan<${InferredResult["to"]}> because constraint LessThanOrEqual<${InferredResult["from"]}> from the value is greater than or equal.`, GenericValue, GenericExpectedConstraint> : never), CastError<"Impossible to cast on LessThan because value does not have compatible constraint.", GenericValue, GenericExpectedConstraint>> : never;
|
|
9
9
|
lessThanOrEqual: GenericExpectedConstraint extends DNumber.LessThanOrEqual<number> ? DCommon.NeverCoalescing<(DNumber.ComputeLessThanOrEqualCompatibility<GenericValue, GenericExpectedConstraint, unknown> extends infer InferredResult extends CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends CompatibilityConstraintResult<true> ? unknown : DCommon.IsNever<DNumber.ExtractLessThanOrEqual<GenericValue>> extends true ? CastError<`Impossible to cast on LessThanOrEqual<${InferredResult["to"]}> because constraint LessThan<${InferredResult["from"]}> from the value is greater than.`, GenericValue, GenericExpectedConstraint> : CastError<`Impossible to cast on LessThanOrEqual<${InferredResult["to"]}> because constraint LessThanOrEqual<${InferredResult["from"]}> from the value is greater than.`, GenericValue, GenericExpectedConstraint> : never), CastError<"Impossible to cast on LessThanOrEqual because value does not have compatible constraint.", GenericValue, GenericExpectedConstraint>> : never;
|
|
10
|
+
integer: GenericExpectedConstraint extends DNumber.Integer ? DCommon.Or<[
|
|
11
|
+
DNumber.IsInteger<GenericValue>,
|
|
12
|
+
DCommon.IsExtends<GenericValue, DNumber.Integer>
|
|
13
|
+
]> extends true ? unknown : CastError<`Impossible to cast on Integer because value ${GenericValue} is not an integer.`, GenericValue, GenericExpectedConstraint> : never;
|
|
14
|
+
notZero: GenericExpectedConstraint extends DNumber.NotZero ? DCommon.Or<[
|
|
15
|
+
DCommon.And<[
|
|
16
|
+
DCommon.Not<DNumber.IsZero<GenericValue>>,
|
|
17
|
+
DNumber.IsLiteral<GenericValue>
|
|
18
|
+
]>,
|
|
19
|
+
DCommon.IsExtends<GenericValue, DNumber.NotZero>
|
|
20
|
+
]> extends true ? unknown : CastError<`Impossible to cast on NotZero because value ${GenericValue} is equal to zero.`, GenericValue, GenericExpectedConstraint> : never;
|
|
21
|
+
safe: GenericExpectedConstraint extends DNumber.Safe ? DCommon.Or<[
|
|
22
|
+
DNumber.IsSafe<GenericValue>,
|
|
23
|
+
DCommon.IsExtends<GenericValue, DNumber.Safe>
|
|
24
|
+
]> extends true ? unknown : CastError<`Impossible to cast on Safe because value ${GenericValue} is not safe.`, GenericValue, GenericExpectedConstraint> : never;
|
|
10
25
|
}
|
|
@@ -2,8 +2,17 @@ import { CastError } from './error';
|
|
|
2
2
|
import { CompatibilityConstraintResult, BaseConstraint } from '../types';
|
|
3
3
|
import type * as DString from '../../../string';
|
|
4
4
|
import type * as DCommon from '../..';
|
|
5
|
+
import type * as DPath from '../../../path';
|
|
5
6
|
export interface ComputeCastConstraintStringRule<GenericValue extends string, GenericExpectedConstraint extends BaseConstraint> {
|
|
6
7
|
maxCharacters: GenericExpectedConstraint extends DString.MaxCharacters<number> ? DCommon.NeverCoalescing<(DString.ComputeMaxCharactersCompatibility<GenericValue, GenericExpectedConstraint, unknown> extends infer InferredResult extends CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends CompatibilityConstraintResult<true> ? unknown : DCommon.IsNever<DString.ExtractLengthEqual<GenericValue>> extends true ? CastError<`Impossible to cast on MaxCharacters<${InferredResult["to"]}> because constraint MaxCharacters<${InferredResult["from"]}> from the value is more than.`, GenericValue, GenericExpectedConstraint> : CastError<`Impossible to cast on MaxCharacters<${InferredResult["to"]}> because constraint LengthEqual<${InferredResult["from"]}> from the value is more than.`, GenericValue, GenericExpectedConstraint> : never), CastError<"Impossible to cast on MaxCharacters because value does not have MaxCharacters constraint.", GenericValue, GenericExpectedConstraint>> : never;
|
|
7
8
|
minCharacters: GenericExpectedConstraint extends DString.MinCharacters<number> ? DCommon.NeverCoalescing<(DString.ComputeMinCharactersCompatibility<GenericValue, GenericExpectedConstraint, unknown> extends infer InferredResult extends CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends CompatibilityConstraintResult<true> ? unknown : DCommon.IsNever<DString.ExtractLengthEqual<GenericValue>> extends true ? CastError<`Impossible to cast on MinCharacters<${InferredResult["to"]}> because constraint MinCharacters<${InferredResult["from"]}> from the value is less than.`, GenericValue, GenericExpectedConstraint> : CastError<`Impossible to cast on MinCharacters<${InferredResult["to"]}> because constraint LengthEqual<${InferredResult["from"]}> from the value is less than.`, GenericValue, GenericExpectedConstraint> : never), CastError<"Impossible to cast on MinCharacters because value does not have MinCharacters constraint.", GenericValue, GenericExpectedConstraint>> : never;
|
|
8
9
|
lengthEqual: GenericExpectedConstraint extends DString.LengthEqual<number> ? DCommon.NeverCoalescing<(DString.ComputeLengthEqualCompatibility<GenericValue, GenericExpectedConstraint, unknown> extends infer InferredResult extends CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends CompatibilityConstraintResult<true> ? unknown : CastError<`Impossible to cast on LengthEqual<${InferredResult["to"]}> because constraint LengthEqual<${InferredResult["from"]}> from the value is not equal.`, GenericValue, GenericExpectedConstraint> : never), CastError<"Impossible to cast on LengthEqual because value does not have LengthEqual constraint.", GenericValue, GenericExpectedConstraint>> : never;
|
|
10
|
+
path: DCommon.IsExtends<GenericExpectedConstraint, DPath.Path> extends true ? DCommon.Or<[
|
|
11
|
+
DPath.IsLiteralPath<GenericValue>,
|
|
12
|
+
DCommon.IsExtends<GenericValue, DPath.Path | DPath.Absolute>
|
|
13
|
+
]> extends true ? unknown : CastError<`Impossible to cast on Path because value ${GenericValue} is not path.`, GenericValue, GenericExpectedConstraint> : never;
|
|
14
|
+
absolutePath: DCommon.IsExtends<GenericExpectedConstraint, DPath.Absolute> extends true ? DCommon.Or<[
|
|
15
|
+
DPath.IsLiteralAbsolutePath<GenericValue>,
|
|
16
|
+
DCommon.IsExtends<GenericValue, DPath.Absolute>
|
|
17
|
+
]> extends true ? unknown : CastError<`Impossible to cast on Absolute Path because value ${GenericValue} is not absolute path.`, GenericValue, GenericExpectedConstraint> : never;
|
|
9
18
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as DArray from '../../../array';
|
|
2
|
+
import type * as DCommon from '../..';
|
|
3
|
+
export interface ComputeInferConstraintArrayRule<GenericInput extends readonly unknown[], GenericOutput extends unknown> {
|
|
4
|
+
maxElements: DArray.ComputeMaxElementsCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DArray.MaxElements<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on MaxElements<${InferredResult["to"]}> because constraint MaxElements<${InferredResult["from"]}> from the value is more than.`> : never;
|
|
5
|
+
minElements: DArray.ComputeMinElementsCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DArray.MinElements<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on MinElements<${InferredResult["to"]}> because constraint MinElements<${InferredResult["from"]}> from the value is less than.`> : never;
|
|
6
|
+
lengthEqual: DArray.ComputeLengthEqualCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DArray.LengthEqual<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on LengthEqual<${InferredResult["to"]}> because constraint LengthEqual<${InferredResult["from"]}> from the value is not equal.`> : never;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComputeInferConstraintArrayRule } from './array';
|
|
2
|
+
import { ComputeInferConstraintNumberRule } from './number';
|
|
3
|
+
import { ComputeInferConstraintStringRule } from './string';
|
|
4
|
+
import type * as DCommon from '../..';
|
|
5
|
+
import type * as DNumber from '../../../number';
|
|
6
|
+
import type * as DObject from '../../../object';
|
|
7
|
+
import type * as DString from '../../../string';
|
|
8
|
+
import type * as DTuple from '../../../tuple';
|
|
9
|
+
export type * from './array';
|
|
10
|
+
export type * from './number';
|
|
11
|
+
export type * from './string';
|
|
12
|
+
export interface ComputeInferConstraintRule<GenericInput extends unknown, GenericOutput extends unknown> {
|
|
13
|
+
string: GenericInput extends string ? DObject.Values<ComputeInferConstraintStringRule<GenericInput, GenericOutput>> : never;
|
|
14
|
+
number: GenericInput extends number ? DObject.Values<ComputeInferConstraintNumberRule<GenericInput, GenericOutput>> : never;
|
|
15
|
+
array: GenericInput extends readonly unknown[] ? DObject.Values<ComputeInferConstraintArrayRule<GenericInput, GenericOutput>> : never;
|
|
16
|
+
}
|
|
17
|
+
export type ComputeInferConstraint<GenericInput extends unknown, GenericOutput extends unknown> = DCommon.Or<[
|
|
18
|
+
DCommon.IsNever<GenericInput>,
|
|
19
|
+
DCommon.IsNever<GenericOutput>
|
|
20
|
+
]> extends true ? unknown : (GenericInput extends unknown ? (GenericOutput extends unknown ? DObject.Values<ComputeInferConstraintRule<GenericInput, GenericOutput>> extends infer InferredResult ? DCommon.ContainExtends<InferredResult, DCommon.ComputedTypeError<string>> extends true ? Extract<InferredResult, DCommon.ComputedTypeError<string>> : GenericInput & DCommon.UnionToIntersection<InferredResult> : never : never) extends infer InferredResult ? DCommon.IsExtends<InferredResult, DCommon.ComputedTypeError<string>> extends true ? InferredResult : Extract<InferredResult, DCommon.BaseConstraint> : never : never) extends infer InferredResult ? DCommon.IsExtends<InferredResult, DCommon.BaseConstraint> extends true ? Extract<InferredResult, DCommon.BaseConstraint> : InferredResult : never;
|
|
21
|
+
export type SupportedOutputInfer = (string | readonly unknown[] | number);
|
|
22
|
+
type ComputeInferInputRequirement<GenericInput extends unknown> = GenericInput extends string ? DString.RequireLiteral<GenericInput> : GenericInput extends number ? DNumber.RequireLiteral<GenericInput> : GenericInput extends readonly unknown[] ? DTuple.Require<GenericInput> : never;
|
|
23
|
+
export declare function infer<GenericOutput extends SupportedOutputInfer, const GenericInput extends DCommon.RemoveConstraint<GenericOutput> = never, GenericComputedOutput = ComputeInferConstraint<GenericInput, GenericOutput>>(input: (GenericInput & ComputeInferInputRequirement<GenericInput> & DCommon.BreakGenericLink<DCommon.NeverCoalescing<GenericComputedOutput extends DCommon.ComputedTypeError<string> ? GenericComputedOutput : never, unknown>>)): DCommon.Or<[
|
|
24
|
+
DCommon.IsNever<GenericInput>,
|
|
25
|
+
DCommon.ContainExtends<GenericComputedOutput, DCommon.ComputedTypeError<string>>
|
|
26
|
+
]> extends true ? GenericOutput : DCommon.BreakGenericLink<DCommon.NeverCoalescing<GenericComputedOutput, GenericInput>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as DCommon from '../..';
|
|
2
|
+
import type * as DNumber from '../../../number';
|
|
3
|
+
export interface ComputeInferConstraintNumberRule<GenericInput extends number, GenericOutput extends unknown> {
|
|
4
|
+
greaterThan: DNumber.ComputeGreaterThanCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DNumber.GreaterThan<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on GreaterThan<${InferredResult["to"]}> because value ${InferredResult["from"]} is less than or equal.`> : never;
|
|
5
|
+
greaterThanOrEqual: DNumber.ComputeGreaterThanOrEqualCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DNumber.GreaterThanOrEqual<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on GreaterThanOrEqual<${InferredResult["to"]}> because value ${InferredResult["from"]} is less than.`> : never;
|
|
6
|
+
lessThan: DNumber.ComputeLessThanCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DNumber.LessThan<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on LessThan<${InferredResult["to"]}> because value ${InferredResult["from"]} is greater than or equal.`> : never;
|
|
7
|
+
lessThanOrEqual: DNumber.ComputeLessThanOrEqualCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DNumber.LessThanOrEqual<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on LessThanOrEqual<${InferredResult["to"]}> because value ${InferredResult["from"]} is greater than.`> : never;
|
|
8
|
+
integer: DCommon.IsExtends<GenericOutput, DNumber.Integer> extends true ? DNumber.IsInteger<GenericInput> extends true ? DNumber.Integer : DCommon.ComputedTypeError<`Impossible to cast on Integer because value ${GenericInput} is not an integer.`> : never;
|
|
9
|
+
notZero: DCommon.IsExtends<GenericOutput, DNumber.NotZero> extends true ? DNumber.IsZero<GenericInput> extends true ? DCommon.ComputedTypeError<`Impossible to cast on NotZero because value ${GenericInput} is equal to zero.`> : DNumber.NotZero : never;
|
|
10
|
+
safe: DCommon.IsExtends<GenericOutput, DNumber.Safe> extends true ? DNumber.IsSafe<GenericInput> extends true ? DNumber.Safe : DCommon.ComputedTypeError<`Impossible to cast on Safe because value ${GenericInput} is not safe.`> : never;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as DCommon from '../..';
|
|
2
|
+
import type * as DString from '../../../string';
|
|
3
|
+
import type * as DPath from '../../../path';
|
|
4
|
+
export interface ComputeInferConstraintStringRule<GenericInput extends string, GenericOutput extends unknown> {
|
|
5
|
+
maxCharacters: DString.ComputeMaxCharactersCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DString.MaxCharacters<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on MaxCharacters<${InferredResult["to"]}> because constraint MaxCharacters<${InferredResult["from"]}> from the value is more than.`> : never;
|
|
6
|
+
minCharacters: DString.ComputeMinCharactersCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DString.MinCharacters<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on MinCharacters<${InferredResult["to"]}> because constraint MinCharacters<${InferredResult["from"]}> from the value is less than.`> : never;
|
|
7
|
+
lengthEqual: DString.ComputeLengthEqualCompatibility<GenericInput, GenericOutput, unknown> extends infer InferredResult extends DCommon.CompatibilityConstraintResult<boolean, number, number> ? InferredResult extends DCommon.CompatibilityConstraintResult<true> ? DString.LengthEqual<InferredResult["to"]> : DCommon.ComputedTypeError<`Impossible to cast on LengthEqual<${InferredResult["to"]}> because constraint LengthEqual<${InferredResult["from"]}> from the value is not equal.`> : never;
|
|
8
|
+
path: DCommon.IsExtends<GenericOutput, DPath.Path | DPath.Absolute> extends true ? DPath.IsLiteralPath<GenericInput> extends true ? DPath.Path : DCommon.ComputedTypeError<`Impossible to cast on Path because value ${GenericInput} is not path.`> : never;
|
|
9
|
+
absolutePath: DCommon.IsExtends<GenericOutput, DPath.Absolute> extends true ? DPath.IsLiteralAbsolutePath<GenericInput> extends true ? DPath.Absolute : DCommon.ComputedTypeError<`Impossible to cast on Absolute Path because value ${GenericInput} is not absolute path.`> : never;
|
|
10
|
+
}
|
package/dist/common/index.cjs
CHANGED
|
@@ -13,6 +13,7 @@ const require_builder = require("./builder.cjs");
|
|
|
13
13
|
const require_callThen = require("./callThen.cjs");
|
|
14
14
|
const require_clone = require("./clone.cjs");
|
|
15
15
|
const require_index = require("./constraint/cast/index.cjs");
|
|
16
|
+
const require_index$1 = require("./constraint/infer/index.cjs");
|
|
16
17
|
const require_remove = require("./constraint/remove.cjs");
|
|
17
18
|
const require_detachObjectMethod = require("./detachObjectMethod.cjs");
|
|
18
19
|
const require_enum = require("./enum.cjs");
|
|
@@ -87,6 +88,7 @@ var common_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
87
88
|
forward: () => require_forward.forward,
|
|
88
89
|
forwardAsserts: () => require_forwardAsserts.forwardAsserts,
|
|
89
90
|
forwardLog: () => require_forwardLog.forwardLog,
|
|
91
|
+
infer: () => require_index$1.infer,
|
|
90
92
|
innerPipe: () => require_innerPipe.innerPipe,
|
|
91
93
|
instanceOf: () => require_instanceOf.instanceOf,
|
|
92
94
|
isType: () => require_isType.isType,
|
|
@@ -161,6 +163,7 @@ exports.falsy = require_falsy.falsy;
|
|
|
161
163
|
exports.forward = require_forward.forward;
|
|
162
164
|
exports.forwardAsserts = require_forwardAsserts.forwardAsserts;
|
|
163
165
|
exports.forwardLog = require_forwardLog.forwardLog;
|
|
166
|
+
exports.infer = require_index$1.infer;
|
|
164
167
|
exports.innerPipe = require_innerPipe.innerPipe;
|
|
165
168
|
exports.instanceOf = require_instanceOf.instanceOf;
|
|
166
169
|
exports.isType = require_isType.isType;
|
package/dist/common/index.mjs
CHANGED
|
@@ -13,6 +13,7 @@ import { MissingBuilderMethodsError, builderKind, createBuilder } from "./builde
|
|
|
13
13
|
import { callThen } from "./callThen.mjs";
|
|
14
14
|
import { clone } from "./clone.mjs";
|
|
15
15
|
import { cast, shameOnYou } from "./constraint/cast/index.mjs";
|
|
16
|
+
import { infer } from "./constraint/infer/index.mjs";
|
|
16
17
|
import { removeConstraint } from "./constraint/remove.mjs";
|
|
17
18
|
import { detachObjectMethod } from "./detachObjectMethod.mjs";
|
|
18
19
|
import { createEnum } from "./enum.mjs";
|
|
@@ -87,6 +88,7 @@ var common_exports = /* @__PURE__ */ __exportAll({
|
|
|
87
88
|
forward: () => forward,
|
|
88
89
|
forwardAsserts: () => forwardAsserts,
|
|
89
90
|
forwardLog: () => forwardLog,
|
|
91
|
+
infer: () => infer,
|
|
90
92
|
innerPipe: () => innerPipe,
|
|
91
93
|
instanceOf: () => instanceOf,
|
|
92
94
|
isType: () => isType,
|
|
@@ -123,4 +125,4 @@ var common_exports = /* @__PURE__ */ __exportAll({
|
|
|
123
125
|
whenNot: () => whenNot
|
|
124
126
|
});
|
|
125
127
|
//#endregion
|
|
126
|
-
export { AssertsError, InvalidBytesInStringError, InvalidMillisecondInStringError, MissingBuilderMethodsError, TheFormData, and, asserts, asyncInnerPipe, asyncLoop, asyncPipe, bindPrototypeMethods, builderKind, callThen, cast, clone, common_exports, createAsyncRetry, createBuilder, createEnum, createExternalPromise, createFormData, createGlobalStore, createInterpolation, createKind, createQueue, createTransformer, detachObjectMethod, equal, escapeRegExp, falsy, forward, forwardAsserts, forwardLog, innerPipe, instanceOf, isType, justExec, justReturn, loop, memo, memoObject, memoPromise, mimeType, or, pipe, pipeCall, prepareAsyncPipe, preparePipe, promiseAll, promiseObject, queueKind, removeConstraint, shameOnYou, simpleClone, stringToBytes, stringToMillisecond, timeout, toCurriedPredicate, toJSON, toNative, toRegExp, transformer, truthy, useAsyncRetry, when, whenElse, whenNot };
|
|
128
|
+
export { AssertsError, InvalidBytesInStringError, InvalidMillisecondInStringError, MissingBuilderMethodsError, TheFormData, and, asserts, asyncInnerPipe, asyncLoop, asyncPipe, bindPrototypeMethods, builderKind, callThen, cast, clone, common_exports, createAsyncRetry, createBuilder, createEnum, createExternalPromise, createFormData, createGlobalStore, createInterpolation, createKind, createQueue, createTransformer, detachObjectMethod, equal, escapeRegExp, falsy, forward, forwardAsserts, forwardLog, infer, innerPipe, instanceOf, isType, justExec, justReturn, loop, memo, memoObject, memoPromise, mimeType, or, pipe, pipeCall, prepareAsyncPipe, preparePipe, promiseAll, promiseObject, queueKind, removeConstraint, shameOnYou, simpleClone, stringToBytes, stringToMillisecond, timeout, toCurriedPredicate, toJSON, toNative, toRegExp, transformer, truthy, useAsyncRetry, when, whenElse, whenNot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_kind = require("../../kind.cjs");
|
|
2
|
+
const require_resultSymbol = require("../../common/resultSymbol.cjs");
|
|
3
|
+
const require_base = require("../base.cjs");
|
|
4
|
+
const require_isAbsolute = require("../../../path/isAbsolute.cjs");
|
|
5
|
+
//#region scripts/dataStructure/constraint/defaults/absolutePath.ts
|
|
6
|
+
const absolutePathConstraintKind = require_kind.createKind("absolute-path-constraint");
|
|
7
|
+
const AbsolutePathConstraint = require_base.createConstraint(absolutePathConstraintKind, ({ init }) => () => init({}, {
|
|
8
|
+
executeCheck: (_self, data) => require_isAbsolute.isAbsolute(data) ? require_resultSymbol.SuccessSymbol : require_resultSymbol.ErrorSymbol,
|
|
9
|
+
isAsynchronous: () => false
|
|
10
|
+
}));
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.AbsolutePathConstraint = AbsolutePathConstraint;
|
|
13
|
+
exports.absolutePathConstraintKind = absolutePathConstraintKind;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConstraintDefinition, Constraint } from '../base';
|
|
2
|
+
import type * as DCommon from '../../../common';
|
|
3
|
+
import type * as DKind from '../../../kind';
|
|
4
|
+
import * as DPath from '../../../path';
|
|
5
|
+
export declare const absolutePathConstraintKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/absolute-path-constraint", unknown>>;
|
|
6
|
+
export interface AbsolutePathConstraintDefinition extends ConstraintDefinition {
|
|
7
|
+
}
|
|
8
|
+
export interface AbsolutePathConstraint extends DCommon.Forward<Constraint<string, string & DPath.Absolute, AbsolutePathConstraintDefinition> & DKind.Kind<typeof absolutePathConstraintKind>> {
|
|
9
|
+
}
|
|
10
|
+
export declare const AbsolutePathConstraint: () => AbsolutePathConstraint;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createKind } from "../../kind.mjs";
|
|
2
|
+
import { ErrorSymbol, SuccessSymbol } from "../../common/resultSymbol.mjs";
|
|
3
|
+
import { createConstraint } from "../base.mjs";
|
|
4
|
+
import { isAbsolute } from "../../../path/isAbsolute.mjs";
|
|
5
|
+
//#region scripts/dataStructure/constraint/defaults/absolutePath.ts
|
|
6
|
+
const absolutePathConstraintKind = createKind("absolute-path-constraint");
|
|
7
|
+
const AbsolutePathConstraint = createConstraint(absolutePathConstraintKind, ({ init }) => () => init({}, {
|
|
8
|
+
executeCheck: (_self, data) => isAbsolute(data) ? SuccessSymbol : ErrorSymbol,
|
|
9
|
+
isAsynchronous: () => false
|
|
10
|
+
}));
|
|
11
|
+
//#endregion
|
|
12
|
+
export { AbsolutePathConstraint, absolutePathConstraintKind };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './absolutePath';
|
|
1
2
|
export * from './allowedCharacters';
|
|
2
3
|
export * from './arrayLengthEqual';
|
|
3
4
|
export * from './betweenThan';
|
|
@@ -18,6 +19,7 @@ export * from './negative';
|
|
|
18
19
|
export * from './notEmpty';
|
|
19
20
|
export * from './notZero';
|
|
20
21
|
export * from './odd';
|
|
22
|
+
export * from './path';
|
|
21
23
|
export * from './positive';
|
|
22
24
|
export * from './refine';
|
|
23
25
|
export * from './safe';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_kind = require("../../kind.cjs");
|
|
2
|
+
const require_resultSymbol = require("../../common/resultSymbol.cjs");
|
|
3
|
+
const require_base = require("../base.cjs");
|
|
4
|
+
const require_is = require("../../../path/is.cjs");
|
|
5
|
+
//#region scripts/dataStructure/constraint/defaults/path.ts
|
|
6
|
+
const pathConstraintKind = require_kind.createKind("path-constraint");
|
|
7
|
+
const PathConstraint = require_base.createConstraint(pathConstraintKind, ({ init }) => () => init({}, {
|
|
8
|
+
executeCheck: (_self, data) => require_is.is(data) ? require_resultSymbol.SuccessSymbol : require_resultSymbol.ErrorSymbol,
|
|
9
|
+
isAsynchronous: () => false
|
|
10
|
+
}));
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.PathConstraint = PathConstraint;
|
|
13
|
+
exports.pathConstraintKind = pathConstraintKind;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConstraintDefinition, Constraint } from '../base';
|
|
2
|
+
import type * as DCommon from '../../../common';
|
|
3
|
+
import type * as DKind from '../../../kind';
|
|
4
|
+
import * as DPath from '../../../path';
|
|
5
|
+
export declare const pathConstraintKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/path-constraint", unknown>>;
|
|
6
|
+
export interface PathConstraintDefinition extends ConstraintDefinition {
|
|
7
|
+
}
|
|
8
|
+
export interface PathConstraint extends DCommon.Forward<Constraint<string, string & DPath.Path, PathConstraintDefinition> & DKind.Kind<typeof pathConstraintKind>> {
|
|
9
|
+
}
|
|
10
|
+
export declare const PathConstraint: () => PathConstraint;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createKind } from "../../kind.mjs";
|
|
2
|
+
import { ErrorSymbol, SuccessSymbol } from "../../common/resultSymbol.mjs";
|
|
3
|
+
import { createConstraint } from "../base.mjs";
|
|
4
|
+
import { is } from "../../../path/is.mjs";
|
|
5
|
+
//#region scripts/dataStructure/constraint/defaults/path.ts
|
|
6
|
+
const pathConstraintKind = createKind("path-constraint");
|
|
7
|
+
const PathConstraint = createConstraint(pathConstraintKind, ({ init }) => () => init({}, {
|
|
8
|
+
executeCheck: (_self, data) => is(data) ? SuccessSymbol : ErrorSymbol,
|
|
9
|
+
isAsynchronous: () => false
|
|
10
|
+
}));
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PathConstraint, pathConstraintKind };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Constraint } from '../base';
|
|
2
2
|
import type * as DDefaults from "../defaults";
|
|
3
3
|
export interface ConstraintsStore {
|
|
4
|
+
absolutePath: DDefaults.AbsolutePathConstraint;
|
|
4
5
|
allowedCharacters: DDefaults.AllowedCharactersConstraint;
|
|
5
6
|
email: DDefaults.EmailConstraint;
|
|
6
7
|
url: DDefaults.UrlConstraint;
|
|
@@ -30,6 +31,7 @@ export interface ConstraintsStore {
|
|
|
30
31
|
greaterThanOrEqual: DDefaults.GreaterThanOrEqualConstraint;
|
|
31
32
|
lessThan: DDefaults.LessThanConstraint;
|
|
32
33
|
lessThanOrEqual: DDefaults.LessThanOrEqualConstraint;
|
|
34
|
+
path: DDefaults.PathConstraint;
|
|
33
35
|
refine: DDefaults.RefineConstraint;
|
|
34
36
|
}
|
|
35
37
|
export type Constraints = Extract<ConstraintsStore[keyof ConstraintsStore], Constraint>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const require_absolutePath = require("../constraint/defaults/absolutePath.cjs");
|
|
2
|
+
//#region scripts/dataStructure/helpers/absolutePath.ts
|
|
3
|
+
function absolutePath() {
|
|
4
|
+
return require_absolutePath.AbsolutePathConstraint();
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.absolutePath = absolutePath;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './absolutePath';
|
|
1
2
|
export * from './allowedCharacters';
|
|
2
3
|
export * from './array';
|
|
3
4
|
export * from './arrayLengthEqual';
|
|
@@ -33,6 +34,7 @@ export * from './object';
|
|
|
33
34
|
export * from './odd';
|
|
34
35
|
export * from './optional';
|
|
35
36
|
export * from './partial';
|
|
37
|
+
export * from './path';
|
|
36
38
|
export * from './positive';
|
|
37
39
|
export * from './record';
|
|
38
40
|
export * from './refine';
|
|
@@ -5,6 +5,7 @@ const require_codec = require("./common/codec.cjs");
|
|
|
5
5
|
const require_error = require("./common/error.cjs");
|
|
6
6
|
const require_errorInterpreter = require("./common/errorInterpreter.cjs");
|
|
7
7
|
const require_base = require("./constraint/base.cjs");
|
|
8
|
+
const require_absolutePath = require("./constraint/defaults/absolutePath.cjs");
|
|
8
9
|
const require_allowedCharacters = require("./constraint/defaults/allowedCharacters.cjs");
|
|
9
10
|
const require_arrayLengthEqual = require("./constraint/defaults/arrayLengthEqual.cjs");
|
|
10
11
|
const require_betweenThan = require("./constraint/defaults/betweenThan.cjs");
|
|
@@ -25,6 +26,7 @@ const require_negative = require("./constraint/defaults/negative.cjs");
|
|
|
25
26
|
const require_notEmpty = require("./constraint/defaults/notEmpty.cjs");
|
|
26
27
|
const require_notZero = require("./constraint/defaults/notZero.cjs");
|
|
27
28
|
const require_odd = require("./constraint/defaults/odd.cjs");
|
|
29
|
+
const require_path = require("./constraint/defaults/path.cjs");
|
|
28
30
|
const require_positive = require("./constraint/defaults/positive.cjs");
|
|
29
31
|
const require_refine = require("./constraint/defaults/refine.cjs");
|
|
30
32
|
const require_safe = require("./constraint/defaults/safe.cjs");
|
|
@@ -46,6 +48,7 @@ const require_string = require("./fundamentalType/defaults/string.cjs");
|
|
|
46
48
|
const require_time = require("./fundamentalType/defaults/time.cjs");
|
|
47
49
|
const require_undefined = require("./fundamentalType/defaults/undefined.cjs");
|
|
48
50
|
const require_identifier$1 = require("./fundamentalType/identifier.cjs");
|
|
51
|
+
const require_absolutePath$1 = require("./helpers/absolutePath.cjs");
|
|
49
52
|
const require_allowedCharacters$1 = require("./helpers/allowedCharacters.cjs");
|
|
50
53
|
const require_base$2 = require("./structure/base.cjs");
|
|
51
54
|
const require_array = require("./structure/defaults/array.cjs");
|
|
@@ -106,6 +109,7 @@ const require_odd$1 = require("./helpers/odd.cjs");
|
|
|
106
109
|
const require_undefined$2 = require("./helpers/undefined.cjs");
|
|
107
110
|
const require_optional = require("./helpers/optional.cjs");
|
|
108
111
|
const require_partial = require("./helpers/partial.cjs");
|
|
112
|
+
const require_path$1 = require("./helpers/path.cjs");
|
|
109
113
|
const require_positive$1 = require("./helpers/positive.cjs");
|
|
110
114
|
const require_record$1 = require("./helpers/record.cjs");
|
|
111
115
|
const require_refine$1 = require("./helpers/refine.cjs");
|
|
@@ -122,6 +126,7 @@ const require_uuid$1 = require("./helpers/uuid.cjs");
|
|
|
122
126
|
const require_regex$1 = require("./helpers/regex.cjs");
|
|
123
127
|
//#region scripts/dataStructure/index.ts
|
|
124
128
|
var dataStructure_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
129
|
+
AbsolutePathConstraint: () => require_absolutePath.AbsolutePathConstraint,
|
|
125
130
|
AllowedCharactersConstraint: () => require_allowedCharacters.AllowedCharactersConstraint,
|
|
126
131
|
ArrayLengthEqualConstraint: () => require_arrayLengthEqual.ArrayLengthEqualConstraint,
|
|
127
132
|
ArrayStructure: () => require_array.ArrayStructure,
|
|
@@ -155,6 +160,7 @@ var dataStructure_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
155
160
|
NumberType: () => require_number$1.NumberType,
|
|
156
161
|
ObjectStructure: () => require_object.ObjectStructure,
|
|
157
162
|
OddConstraint: () => require_odd.OddConstraint,
|
|
163
|
+
PathConstraint: () => require_path.PathConstraint,
|
|
158
164
|
PositiveConstraint: () => require_positive.PositiveConstraint,
|
|
159
165
|
RecordStructure: () => require_record.RecordStructure,
|
|
160
166
|
RefineConstraint: () => require_refine.RefineConstraint,
|
|
@@ -182,6 +188,8 @@ var dataStructure_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
182
188
|
UnionStructure: () => require_union.UnionStructure,
|
|
183
189
|
UrlConstraint: () => require_url.UrlConstraint,
|
|
184
190
|
UuidConstraint: () => require_uuid.UuidConstraint,
|
|
191
|
+
absolutePath: () => require_absolutePath$1.absolutePath,
|
|
192
|
+
absolutePathConstraintKind: () => require_absolutePath.absolutePathConstraintKind,
|
|
185
193
|
allowedCharacters: () => require_allowedCharacters$1.allowedCharacters,
|
|
186
194
|
allowedCharactersConstraintKind: () => require_allowedCharacters.allowedCharactersConstraintKind,
|
|
187
195
|
array: () => require_array$1.array,
|
|
@@ -273,6 +281,8 @@ var dataStructure_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
273
281
|
oddConstraintKind: () => require_odd.oddConstraintKind,
|
|
274
282
|
optional: () => require_optional.optional,
|
|
275
283
|
partial: () => require_partial.partial,
|
|
284
|
+
path: () => require_path$1.path,
|
|
285
|
+
pathConstraintKind: () => require_path.pathConstraintKind,
|
|
276
286
|
positive: () => require_positive$1.positive,
|
|
277
287
|
positiveConstraintKind: () => require_positive.positiveConstraintKind,
|
|
278
288
|
record: () => require_record$1.record,
|
|
@@ -315,6 +325,7 @@ var dataStructure_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
315
325
|
uuidConstraintKind: () => require_uuid.uuidConstraintKind
|
|
316
326
|
});
|
|
317
327
|
//#endregion
|
|
328
|
+
exports.AbsolutePathConstraint = require_absolutePath.AbsolutePathConstraint;
|
|
318
329
|
exports.AllowedCharactersConstraint = require_allowedCharacters.AllowedCharactersConstraint;
|
|
319
330
|
exports.ArrayLengthEqualConstraint = require_arrayLengthEqual.ArrayLengthEqualConstraint;
|
|
320
331
|
exports.ArrayStructure = require_array.ArrayStructure;
|
|
@@ -348,6 +359,7 @@ exports.NumberLiteralType = require_numberLiteral.NumberLiteralType;
|
|
|
348
359
|
exports.NumberType = require_number$1.NumberType;
|
|
349
360
|
exports.ObjectStructure = require_object.ObjectStructure;
|
|
350
361
|
exports.OddConstraint = require_odd.OddConstraint;
|
|
362
|
+
exports.PathConstraint = require_path.PathConstraint;
|
|
351
363
|
exports.PositiveConstraint = require_positive.PositiveConstraint;
|
|
352
364
|
exports.RecordStructure = require_record.RecordStructure;
|
|
353
365
|
exports.RefineConstraint = require_refine.RefineConstraint;
|
|
@@ -375,6 +387,8 @@ exports.UndefinedType = require_undefined$1.UndefinedType;
|
|
|
375
387
|
exports.UnionStructure = require_union.UnionStructure;
|
|
376
388
|
exports.UrlConstraint = require_url.UrlConstraint;
|
|
377
389
|
exports.UuidConstraint = require_uuid.UuidConstraint;
|
|
390
|
+
exports.absolutePath = require_absolutePath$1.absolutePath;
|
|
391
|
+
exports.absolutePathConstraintKind = require_absolutePath.absolutePathConstraintKind;
|
|
378
392
|
exports.allowedCharacters = require_allowedCharacters$1.allowedCharacters;
|
|
379
393
|
exports.allowedCharactersConstraintKind = require_allowedCharacters.allowedCharactersConstraintKind;
|
|
380
394
|
exports.array = require_array$1.array;
|
|
@@ -472,6 +486,8 @@ exports.odd = require_odd$1.odd;
|
|
|
472
486
|
exports.oddConstraintKind = require_odd.oddConstraintKind;
|
|
473
487
|
exports.optional = require_optional.optional;
|
|
474
488
|
exports.partial = require_partial.partial;
|
|
489
|
+
exports.path = require_path$1.path;
|
|
490
|
+
exports.pathConstraintKind = require_path.pathConstraintKind;
|
|
475
491
|
exports.positive = require_positive$1.positive;
|
|
476
492
|
exports.positiveConstraintKind = require_positive.positiveConstraintKind;
|
|
477
493
|
exports.record = require_record$1.record;
|
|
@@ -5,6 +5,7 @@ import { codecKind, codecsKind, createCodec, createCodecs } from "./common/codec
|
|
|
5
5
|
import { createErrorHandler, createGetErrorHandler, decodeIssueKind, encodeIssueKind, issueKind } from "./common/error.mjs";
|
|
6
6
|
import { createErrorInterpreter } from "./common/errorInterpreter.mjs";
|
|
7
7
|
import { constraintKind, createConstraint } from "./constraint/base.mjs";
|
|
8
|
+
import { AbsolutePathConstraint, absolutePathConstraintKind } from "./constraint/defaults/absolutePath.mjs";
|
|
8
9
|
import { AllowedCharactersConstraint, allowedCharactersConstraintKind } from "./constraint/defaults/allowedCharacters.mjs";
|
|
9
10
|
import { ArrayLengthEqualConstraint, arrayLengthEqualConstraintKind } from "./constraint/defaults/arrayLengthEqual.mjs";
|
|
10
11
|
import { BetweenThanConstraint, betweenThanConstraintKind } from "./constraint/defaults/betweenThan.mjs";
|
|
@@ -25,6 +26,7 @@ import { NegativeConstraint, negativeConstraintKind } from "./constraint/default
|
|
|
25
26
|
import { NotEmptyConstraint, notEmptyConstraintKind } from "./constraint/defaults/notEmpty.mjs";
|
|
26
27
|
import { NotZeroConstraint, notZeroConstraintKind } from "./constraint/defaults/notZero.mjs";
|
|
27
28
|
import { OddConstraint, oddConstraintKind } from "./constraint/defaults/odd.mjs";
|
|
29
|
+
import { PathConstraint, pathConstraintKind } from "./constraint/defaults/path.mjs";
|
|
28
30
|
import { PositiveConstraint, positiveConstraintKind } from "./constraint/defaults/positive.mjs";
|
|
29
31
|
import { RefineConstraint, refineConstraintKind } from "./constraint/defaults/refine.mjs";
|
|
30
32
|
import { SafeConstraint, safeConstraintKind } from "./constraint/defaults/safe.mjs";
|
|
@@ -46,6 +48,7 @@ import { TheString, stringFundamentalTypeKind } from "./fundamentalType/defaults
|
|
|
46
48
|
import { TheTime, timeFundamentalTypeKind } from "./fundamentalType/defaults/time.mjs";
|
|
47
49
|
import { TheUndefined, undefinedFundamentalTypeKind } from "./fundamentalType/defaults/undefined.mjs";
|
|
48
50
|
import { fundamentalTypeIdentifier } from "./fundamentalType/identifier.mjs";
|
|
51
|
+
import { absolutePath } from "./helpers/absolutePath.mjs";
|
|
49
52
|
import { allowedCharacters } from "./helpers/allowedCharacters.mjs";
|
|
50
53
|
import { StructureClass, createStructure, structureKind } from "./structure/base.mjs";
|
|
51
54
|
import { ArrayStructure, arrayStructureKind } from "./structure/defaults/array.mjs";
|
|
@@ -106,6 +109,7 @@ import { odd } from "./helpers/odd.mjs";
|
|
|
106
109
|
import { undefined as undefinedHelper } from "./helpers/undefined.mjs";
|
|
107
110
|
import { optional } from "./helpers/optional.mjs";
|
|
108
111
|
import { partial } from "./helpers/partial.mjs";
|
|
112
|
+
import { path } from "./helpers/path.mjs";
|
|
109
113
|
import { positive } from "./helpers/positive.mjs";
|
|
110
114
|
import { record } from "./helpers/record.mjs";
|
|
111
115
|
import { refine } from "./helpers/refine.mjs";
|
|
@@ -122,6 +126,7 @@ import { uuid } from "./helpers/uuid.mjs";
|
|
|
122
126
|
import { regex } from "./helpers/regex.mjs";
|
|
123
127
|
//#region scripts/dataStructure/index.ts
|
|
124
128
|
var dataStructure_exports = /* @__PURE__ */ __exportAll({
|
|
129
|
+
AbsolutePathConstraint: () => AbsolutePathConstraint,
|
|
125
130
|
AllowedCharactersConstraint: () => AllowedCharactersConstraint,
|
|
126
131
|
ArrayLengthEqualConstraint: () => ArrayLengthEqualConstraint,
|
|
127
132
|
ArrayStructure: () => ArrayStructure,
|
|
@@ -155,6 +160,7 @@ var dataStructure_exports = /* @__PURE__ */ __exportAll({
|
|
|
155
160
|
NumberType: () => NumberType,
|
|
156
161
|
ObjectStructure: () => ObjectStructure,
|
|
157
162
|
OddConstraint: () => OddConstraint,
|
|
163
|
+
PathConstraint: () => PathConstraint,
|
|
158
164
|
PositiveConstraint: () => PositiveConstraint,
|
|
159
165
|
RecordStructure: () => RecordStructure,
|
|
160
166
|
RefineConstraint: () => RefineConstraint,
|
|
@@ -182,6 +188,8 @@ var dataStructure_exports = /* @__PURE__ */ __exportAll({
|
|
|
182
188
|
UnionStructure: () => UnionStructure,
|
|
183
189
|
UrlConstraint: () => UrlConstraint,
|
|
184
190
|
UuidConstraint: () => UuidConstraint,
|
|
191
|
+
absolutePath: () => absolutePath,
|
|
192
|
+
absolutePathConstraintKind: () => absolutePathConstraintKind,
|
|
185
193
|
allowedCharacters: () => allowedCharacters,
|
|
186
194
|
allowedCharactersConstraintKind: () => allowedCharactersConstraintKind,
|
|
187
195
|
array: () => array,
|
|
@@ -273,6 +281,8 @@ var dataStructure_exports = /* @__PURE__ */ __exportAll({
|
|
|
273
281
|
oddConstraintKind: () => oddConstraintKind,
|
|
274
282
|
optional: () => optional,
|
|
275
283
|
partial: () => partial,
|
|
284
|
+
path: () => path,
|
|
285
|
+
pathConstraintKind: () => pathConstraintKind,
|
|
276
286
|
positive: () => positive,
|
|
277
287
|
positiveConstraintKind: () => positiveConstraintKind,
|
|
278
288
|
record: () => record,
|
|
@@ -315,4 +325,4 @@ var dataStructure_exports = /* @__PURE__ */ __exportAll({
|
|
|
315
325
|
uuidConstraintKind: () => uuidConstraintKind
|
|
316
326
|
});
|
|
317
327
|
//#endregion
|
|
318
|
-
export { AllowedCharactersConstraint, ArrayLengthEqualConstraint, ArrayStructure, BetweenThanConstraint, BetweenThanOrEqualConstraint, BigintLiteralType, BigintType, BooleanLiteralType, BooleanType, DateType, EmailConstraint, ErrorSymbol, EvenConstraint, GreaterThanConstraint, GreaterThanOrEqualConstraint, IntegerConstraint, LazyStructure, LessThanConstraint, LessThanOrEqualConstraint, MaxCharactersConstraint, MaxElementsConstraint, MinCharactersConstraint, MinElementsConstraint, MultipleOfConstraint, NegativeConstraint, NonEncodableStringStructure, NotEmptyConstraint, NotZeroConstraint, NullType, NumberLiteralType, NumberType, ObjectStructure, OddConstraint, PositiveConstraint, RecordStructure, RefineConstraint, RegexConstraint, SafeConstraint, StrictNegativeConstraint, StrictPositiveConstraint, StringLengthEqualConstraint, StringLiteralType, StringType, StructureClass, SuccessSymbol, TheBigint, TheBoolean, TheDate, TheNull, TheNumber, TheString, TheTime, TheUndefined, TimeType, TrimmedConstraint, TypeStructure, UndefinedType, UnionStructure, UrlConstraint, UuidConstraint, allowedCharacters, allowedCharactersConstraintKind, array, arrayLengthEqual, arrayLengthEqualConstraintKind, arrayStructureKind, betweenThan, betweenThanConstraintKind, betweenThanOrEqual, betweenThanOrEqualConstraintKind, bigint, bigintFundamentalTypeKind, bigintLiteralTypeKind, bigintTypeKind, boolean, booleanFundamentalTypeKind, booleanLiteralTypeKind, booleanTypeKind, codecKind, codecsKind, constraintIdentifier, constraintKind, createCodec, createCodecs, createConstraint, createErrorHandler, createErrorInterpreter, createFundamentalType, createGetErrorHandler, createKind, createStructure, createType, dataStructure_exports, date, dateFundamentalTypeKind, dateTypeKind, decodeIssueKind, email, emailConstraintKind, encodeIssueKind, even, evenConstraintKind, extend, fundamentalTypeIdentifier, fundamentalTypeKind, greaterThan, greaterThanConstraintKind, greaterThanOrEqual, greaterThanOrEqualConstraintKind, integer, integerConstraintKind, isNullStructure, isUndefinedStructure, issueKind, lazy, lazyStructureKind, lessThan, lessThanConstraintKind, lessThanOrEqual, lessThanOrEqualConstraintKind, literal, maxCharacters, maxCharactersConstraintKind, maxElements, maxElementsConstraintKind, minCharacters, minCharactersConstraintKind, minElements, minElementsConstraintKind, multipleOf, multipleOfConstraintKind, negative, negativeConstraintKind, nonEncodableStringStructureKind, notEmpty, notEmptyConstraintKind, notZero, notZeroConstraintKind, nullHelper as null, nullFundamentalTypeKind, nullTypeKind, nullable, number, numberFundamentalTypeKind, numberLiteralTypeKind, numberTypeKind, object, objectStructureKind, odd, oddConstraintKind, optional, partial, positive, positiveConstraintKind, record, recordStructureKind, refine, refineConstraintKind, regex, regexConstraintKind, required, safe, safeConstraintKind, strictNegative, strictNegativeConstraintKind, strictPositive, strictPositiveConstraintKind, string, stringFundamentalTypeKind, stringLengthEqual, stringLengthEqualConstraintKind, stringLiteralTypeKind, stringTypeKind, structureIdentifier, structureKind, time, timeFundamentalTypeKind, timeTypeKind, trimmed, trimmedConstraintKind, typeIdentifier, typeKind, typeStructureKind, undefinedHelper as undefined, undefinedFundamentalTypeKind, undefinedTypeKind, union, unionStructureKind, url, urlConstraintKind, uuid, uuidConstraintKind };
|
|
328
|
+
export { AbsolutePathConstraint, AllowedCharactersConstraint, ArrayLengthEqualConstraint, ArrayStructure, BetweenThanConstraint, BetweenThanOrEqualConstraint, BigintLiteralType, BigintType, BooleanLiteralType, BooleanType, DateType, EmailConstraint, ErrorSymbol, EvenConstraint, GreaterThanConstraint, GreaterThanOrEqualConstraint, IntegerConstraint, LazyStructure, LessThanConstraint, LessThanOrEqualConstraint, MaxCharactersConstraint, MaxElementsConstraint, MinCharactersConstraint, MinElementsConstraint, MultipleOfConstraint, NegativeConstraint, NonEncodableStringStructure, NotEmptyConstraint, NotZeroConstraint, NullType, NumberLiteralType, NumberType, ObjectStructure, OddConstraint, PathConstraint, PositiveConstraint, RecordStructure, RefineConstraint, RegexConstraint, SafeConstraint, StrictNegativeConstraint, StrictPositiveConstraint, StringLengthEqualConstraint, StringLiteralType, StringType, StructureClass, SuccessSymbol, TheBigint, TheBoolean, TheDate, TheNull, TheNumber, TheString, TheTime, TheUndefined, TimeType, TrimmedConstraint, TypeStructure, UndefinedType, UnionStructure, UrlConstraint, UuidConstraint, absolutePath, absolutePathConstraintKind, allowedCharacters, allowedCharactersConstraintKind, array, arrayLengthEqual, arrayLengthEqualConstraintKind, arrayStructureKind, betweenThan, betweenThanConstraintKind, betweenThanOrEqual, betweenThanOrEqualConstraintKind, bigint, bigintFundamentalTypeKind, bigintLiteralTypeKind, bigintTypeKind, boolean, booleanFundamentalTypeKind, booleanLiteralTypeKind, booleanTypeKind, codecKind, codecsKind, constraintIdentifier, constraintKind, createCodec, createCodecs, createConstraint, createErrorHandler, createErrorInterpreter, createFundamentalType, createGetErrorHandler, createKind, createStructure, createType, dataStructure_exports, date, dateFundamentalTypeKind, dateTypeKind, decodeIssueKind, email, emailConstraintKind, encodeIssueKind, even, evenConstraintKind, extend, fundamentalTypeIdentifier, fundamentalTypeKind, greaterThan, greaterThanConstraintKind, greaterThanOrEqual, greaterThanOrEqualConstraintKind, integer, integerConstraintKind, isNullStructure, isUndefinedStructure, issueKind, lazy, lazyStructureKind, lessThan, lessThanConstraintKind, lessThanOrEqual, lessThanOrEqualConstraintKind, literal, maxCharacters, maxCharactersConstraintKind, maxElements, maxElementsConstraintKind, minCharacters, minCharactersConstraintKind, minElements, minElementsConstraintKind, multipleOf, multipleOfConstraintKind, negative, negativeConstraintKind, nonEncodableStringStructureKind, notEmpty, notEmptyConstraintKind, notZero, notZeroConstraintKind, nullHelper as null, nullFundamentalTypeKind, nullTypeKind, nullable, number, numberFundamentalTypeKind, numberLiteralTypeKind, numberTypeKind, object, objectStructureKind, odd, oddConstraintKind, optional, partial, path, pathConstraintKind, positive, positiveConstraintKind, record, recordStructureKind, refine, refineConstraintKind, regex, regexConstraintKind, required, safe, safeConstraintKind, strictNegative, strictNegativeConstraintKind, strictPositive, strictPositiveConstraintKind, string, stringFundamentalTypeKind, stringLengthEqual, stringLengthEqualConstraintKind, stringLiteralTypeKind, stringTypeKind, structureIdentifier, structureKind, time, timeFundamentalTypeKind, timeTypeKind, trimmed, trimmedConstraintKind, typeIdentifier, typeKind, typeStructureKind, undefinedHelper as undefined, undefinedFundamentalTypeKind, undefinedTypeKind, union, unionStructureKind, url, urlConstraintKind, uuid, uuidConstraintKind };
|