@duplojs/lang 0.0.1-beta.2 → 0.0.1-beta.3
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/constraint/index.d.ts +1 -0
- package/dist/common/constraint/remove.cjs +6 -0
- package/dist/common/constraint/remove.d.ts +2 -0
- package/dist/common/constraint/remove.mjs +6 -0
- package/dist/common/index.cjs +3 -0
- package/dist/common/index.mjs +3 -1
- package/dist/common/types/forward.d.ts +1 -0
- package/dist/common/types/index.d.ts +1 -0
- package/dist/dataStructure/common/codec.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/allowedCharacters.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/arrayLengthEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/betweenThan.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/betweenThanOrEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/email.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/even.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/greaterThan.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/greaterThanOrEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/index.d.ts +1 -0
- package/dist/dataStructure/constraint/defaults/integer.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/lessThan.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/lessThanOrEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/maxCharacters.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/maxElements.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/minCharacters.cjs +3 -3
- package/dist/dataStructure/constraint/defaults/minCharacters.d.ts +2 -2
- package/dist/dataStructure/constraint/defaults/minCharacters.mjs +3 -3
- package/dist/dataStructure/constraint/defaults/minElements.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/multipleOf.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/negative.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/notEmpty.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/notZero.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/odd.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/positive.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/refine.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/regex.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/regex.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/regex.mjs +12 -0
- package/dist/dataStructure/constraint/defaults/safe.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/strictNegative.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/strictPositive.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/stringLengthEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/trimmed.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/url.cjs +2 -2
- package/dist/dataStructure/constraint/defaults/url.d.ts +2 -3
- package/dist/dataStructure/constraint/defaults/url.mjs +2 -2
- package/dist/dataStructure/constraint/defaults/uuid.cjs +1 -3
- package/dist/dataStructure/constraint/defaults/uuid.d.ts +1 -3
- package/dist/dataStructure/constraint/defaults/uuid.mjs +3 -4
- package/dist/dataStructure/constraint/identifier.d.ts +4 -2
- package/dist/dataStructure/constraint/types/constraints.d.ts +18 -15
- package/dist/dataStructure/fundamentalType/defaults/bigint.d.ts +1 -1
- package/dist/dataStructure/fundamentalType/defaults/boolean.d.ts +1 -1
- package/dist/dataStructure/fundamentalType/defaults/date.d.ts +1 -1
- package/dist/dataStructure/fundamentalType/defaults/null.d.ts +1 -1
- package/dist/dataStructure/fundamentalType/defaults/number.d.ts +1 -1
- package/dist/dataStructure/fundamentalType/defaults/string.d.ts +1 -1
- package/dist/dataStructure/fundamentalType/defaults/time.d.ts +1 -1
- package/dist/dataStructure/fundamentalType/defaults/undefined.d.ts +1 -1
- package/dist/dataStructure/fundamentalType/identifier.d.ts +4 -2
- package/dist/dataStructure/helpers/index.d.ts +1 -0
- package/dist/dataStructure/helpers/nullable.cjs +5 -2
- package/dist/dataStructure/helpers/nullable.mjs +5 -2
- package/dist/dataStructure/helpers/optional.cjs +5 -2
- package/dist/dataStructure/helpers/optional.mjs +5 -2
- package/dist/dataStructure/helpers/partial.cjs +5 -2
- package/dist/dataStructure/helpers/partial.mjs +5 -2
- package/dist/dataStructure/helpers/regex.cjs +7 -0
- package/dist/dataStructure/helpers/regex.d.ts +2 -0
- package/dist/dataStructure/helpers/regex.mjs +7 -0
- package/dist/dataStructure/helpers/required.cjs +6 -3
- package/dist/dataStructure/helpers/required.d.ts +2 -1
- package/dist/dataStructure/helpers/required.mjs +6 -3
- package/dist/dataStructure/helpers/url.cjs +2 -2
- package/dist/dataStructure/helpers/url.d.ts +1 -2
- package/dist/dataStructure/helpers/url.mjs +2 -2
- package/dist/dataStructure/index.cjs +12 -6
- package/dist/dataStructure/index.mjs +11 -7
- package/dist/dataStructure/structure/defaults/array.d.ts +1 -1
- package/dist/dataStructure/structure/defaults/lazy.cjs +6 -1
- package/dist/dataStructure/structure/defaults/lazy.d.ts +1 -1
- package/dist/dataStructure/structure/defaults/lazy.mjs +6 -1
- package/dist/dataStructure/structure/defaults/nonEncodableString.d.ts +1 -1
- package/dist/dataStructure/structure/defaults/object.d.ts +1 -1
- package/dist/dataStructure/structure/defaults/record.cjs +7 -7
- package/dist/dataStructure/structure/defaults/record.d.ts +2 -2
- package/dist/dataStructure/structure/defaults/record.mjs +7 -7
- package/dist/dataStructure/structure/defaults/type.d.ts +1 -1
- package/dist/dataStructure/structure/defaults/union.cjs +11 -5
- package/dist/dataStructure/structure/defaults/union.d.ts +2 -2
- package/dist/dataStructure/structure/defaults/union.mjs +11 -5
- package/dist/dataStructure/structure/identifier.d.ts +4 -2
- package/dist/dataStructure/type/defaults/bigint.d.ts +1 -1
- package/dist/dataStructure/type/defaults/bigintLiteral.d.ts +1 -1
- package/dist/dataStructure/type/defaults/boolean.d.ts +1 -1
- package/dist/dataStructure/type/defaults/booleanLiteral.d.ts +1 -1
- package/dist/dataStructure/type/defaults/date.d.ts +1 -1
- package/dist/dataStructure/type/defaults/null.d.ts +1 -1
- package/dist/dataStructure/type/defaults/number.d.ts +1 -1
- package/dist/dataStructure/type/defaults/numberLiteral.d.ts +1 -1
- package/dist/dataStructure/type/defaults/string.d.ts +1 -1
- package/dist/dataStructure/type/defaults/stringLiteral.d.ts +1 -1
- package/dist/dataStructure/type/defaults/time.d.ts +1 -1
- package/dist/dataStructure/type/defaults/undefined.d.ts +1 -1
- package/dist/dataStructure/type/identifier.d.ts +4 -2
- package/dist/index.cjs +2 -0
- package/dist/index.mjs +2 -1
- package/dist/invocation/flow/base.d.ts +1 -1
- package/dist/invocation/flow/controller/defaults/aborter.cjs +4 -1
- package/dist/invocation/flow/controller/defaults/aborter.d.ts +6 -3
- package/dist/invocation/flow/controller/defaults/aborter.mjs +4 -1
- package/dist/invocation/flow/controller/defaults/debounce.d.ts +1 -1
- package/dist/invocation/flow/controller/defaults/filter.d.ts +1 -1
- package/dist/invocation/flow/controller/defaults/retry.d.ts +1 -1
- package/dist/invocation/flow/controller/defaults/throttling.d.ts +1 -1
- package/dist/invocation/flow/controller/defaults/timeout.d.ts +1 -1
- package/dist/kind/createIdentifier.d.ts +2 -2
- package/dist/modeling/entity/base.d.ts +3 -4
- package/dist/modeling/newType/base.d.ts +1 -1
- package/dist/modeling/taggedObject/base.d.ts +3 -4
- package/dist/string/isUrl.cjs +2 -11
- package/dist/string/isUrl.d.ts +1 -5
- package/dist/string/isUrl.mjs +2 -11
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Structure } from './base';
|
|
2
|
+
import { Structures } from './types';
|
|
3
|
+
import * as DKind from '../../kind';
|
|
2
4
|
export declare const structureIdentifier: {
|
|
3
|
-
<GenericKindHandler extends
|
|
4
|
-
<GenericKindHandler extends
|
|
5
|
+
<GenericKindHandler extends DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/array-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/object-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangModeling/entity-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangModeling/tagged-object-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/lazy-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/record-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/union-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/non-encodable-string-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangModeling/new-type-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", Record<string, unknown>>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", readonly unknown[]>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", import('../../modeling').Entity<string> & Record<string, unknown>>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", import('../../modeling').ObjectTag<string>>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", String>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", import('../../modeling').NewType<string, never>>>, GenericInput extends unknown, GenericGroupedKind extends GenericKindHandler extends DKind.Handler<DKind.Definition<string, unknown>> ? DKind.Kind<GenericKindHandler, GenericKindHandler["definition"]["value"]> : never>(kind: GenericKindHandler | GenericKindHandler[]): (input: GenericInput) => input is (GenericInput extends Structure<unknown, import('..').StructureDefinition<readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]>> ? (Structure<unknown, import('..').StructureDefinition<readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]>> extends infer T ? T extends Structure<unknown, import('..').StructureDefinition<readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]>> ? T extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').ObjectStructure<Record<string, unknown>, readonly import('..').Constraint<Record<string, unknown>, Record<string, unknown>, import('..').ConstraintDefinition>[]> extends infer T_1 ? T_1 extends import('..').ObjectStructure<Record<string, unknown>, readonly import('..').Constraint<Record<string, unknown>, Record<string, unknown>, import('..').ConstraintDefinition>[]> ? T_1 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').ArrayStructure<readonly unknown[], readonly import('..').Constraint<readonly unknown[], readonly unknown[], import('..').ConstraintDefinition>[]> extends infer T_2 ? T_2 extends import('..').ArrayStructure<readonly unknown[], readonly import('..').Constraint<readonly unknown[], readonly unknown[], import('..').ConstraintDefinition>[]> ? T_2 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').TypeStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> extends infer T_3 ? T_3 extends import('..').TypeStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> ? T_3 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('../../modeling').EntityStructure<string, Record<string, unknown>> extends infer T_4 ? T_4 extends import('../../modeling').EntityStructure<string, Record<string, unknown>> ? T_4 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('../../modeling').TaggedObjectStructure<import('../../modeling').ObjectTag<string>> extends infer T_5 ? T_5 extends import('../../modeling').TaggedObjectStructure<import('../../modeling').ObjectTag<string>> ? T_5 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').LazyStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> extends infer T_6 ? T_6 extends import('..').LazyStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> ? T_6 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').RecordStructure<Record<string, unknown>, readonly import('..').Constraint<Record<string, unknown>, Record<string, unknown>, import('..').ConstraintDefinition>[]> extends infer T_7 ? T_7 extends import('..').RecordStructure<Record<string, unknown>, readonly import('..').Constraint<Record<string, unknown>, Record<string, unknown>, import('..').ConstraintDefinition>[]> ? T_7 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').UnionStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> extends infer T_8 ? T_8 extends import('..').UnionStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> ? T_8 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').NonEncodableStringStructure extends infer T_9 ? T_9 extends import('..').NonEncodableStringStructure ? T_9 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('../../modeling').NewTypeStructure<string, unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> extends infer T_10 ? T_10 extends import('../../modeling').NewTypeStructure<string, unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> ? T_10 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) : never) | Extract<GenericInput, GenericGroupedKind>;
|
|
6
|
+
<GenericKindHandler extends DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/array-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/object-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangModeling/entity-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangModeling/tagged-object-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/lazy-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/record-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/union-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/non-encodable-string-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangModeling/new-type-structure", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", Record<string, unknown>>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", readonly unknown[]>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", import('../../modeling').Entity<string> & Record<string, unknown>>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", import('../../modeling').ObjectTag<string>>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", String>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/structure", import('../../modeling').NewType<string, never>>>, GenericInput extends unknown, GenericGroupedKind extends GenericKindHandler extends DKind.Handler<DKind.Definition<string, unknown>> ? DKind.Kind<GenericKindHandler, GenericKindHandler["definition"]["value"]> : never>(input: GenericInput, kind: GenericKindHandler | GenericKindHandler[]): input is (GenericInput extends Structure<unknown, import('..').StructureDefinition<readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]>> ? (Structure<unknown, import('..').StructureDefinition<readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]>> extends infer T ? T extends Structure<unknown, import('..').StructureDefinition<readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]>> ? T extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').ObjectStructure<Record<string, unknown>, readonly import('..').Constraint<Record<string, unknown>, Record<string, unknown>, import('..').ConstraintDefinition>[]> extends infer T_1 ? T_1 extends import('..').ObjectStructure<Record<string, unknown>, readonly import('..').Constraint<Record<string, unknown>, Record<string, unknown>, import('..').ConstraintDefinition>[]> ? T_1 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').ArrayStructure<readonly unknown[], readonly import('..').Constraint<readonly unknown[], readonly unknown[], import('..').ConstraintDefinition>[]> extends infer T_2 ? T_2 extends import('..').ArrayStructure<readonly unknown[], readonly import('..').Constraint<readonly unknown[], readonly unknown[], import('..').ConstraintDefinition>[]> ? T_2 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').TypeStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> extends infer T_3 ? T_3 extends import('..').TypeStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> ? T_3 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('../../modeling').EntityStructure<string, Record<string, unknown>> extends infer T_4 ? T_4 extends import('../../modeling').EntityStructure<string, Record<string, unknown>> ? T_4 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('../../modeling').TaggedObjectStructure<import('../../modeling').ObjectTag<string>> extends infer T_5 ? T_5 extends import('../../modeling').TaggedObjectStructure<import('../../modeling').ObjectTag<string>> ? T_5 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').LazyStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> extends infer T_6 ? T_6 extends import('..').LazyStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> ? T_6 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').RecordStructure<Record<string, unknown>, readonly import('..').Constraint<Record<string, unknown>, Record<string, unknown>, import('..').ConstraintDefinition>[]> extends infer T_7 ? T_7 extends import('..').RecordStructure<Record<string, unknown>, readonly import('..').Constraint<Record<string, unknown>, Record<string, unknown>, import('..').ConstraintDefinition>[]> ? T_7 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').UnionStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> extends infer T_8 ? T_8 extends import('..').UnionStructure<unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> ? T_8 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('..').NonEncodableStringStructure extends infer T_9 ? T_9 extends import('..').NonEncodableStringStructure ? T_9 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) | (import('../../modeling').NewTypeStructure<string, unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> extends infer T_10 ? T_10 extends import('../../modeling').NewTypeStructure<string, unknown, readonly import('..').Constraint<unknown, unknown, import('..').ConstraintDefinition>[]> ? T_10 extends GenericInput ? GenericInput & Structures extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Structures : never : never : never : never) : never) | Extract<GenericInput, GenericGroupedKind>;
|
|
5
7
|
};
|
|
@@ -5,6 +5,6 @@ import * as FundamentalType from "../../fundamentalType";
|
|
|
5
5
|
export declare const bigintTypeKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/bigint-type", unknown>>;
|
|
6
6
|
export interface BigintTypeDefinition extends TypeDefinition {
|
|
7
7
|
}
|
|
8
|
-
export interface BigintType extends DCommon.
|
|
8
|
+
export interface BigintType extends DCommon.Forward<Type<FundamentalType.TheBigint, bigint, BigintTypeDefinition> & DKind.Kind<typeof bigintTypeKind>> {
|
|
9
9
|
}
|
|
10
10
|
export declare const BigintType: () => BigintType;
|
|
@@ -6,6 +6,6 @@ export declare const bigintLiteralTypeKind: DKind.Handler<DKind.Definition<"@Dup
|
|
|
6
6
|
export interface BigintLiteralTypeDefinition extends TypeDefinition {
|
|
7
7
|
value: bigint;
|
|
8
8
|
}
|
|
9
|
-
export interface BigintLiteralType<GenericValue extends bigint = bigint> extends DCommon.
|
|
9
|
+
export interface BigintLiteralType<GenericValue extends bigint = bigint> extends DCommon.Forward<Type<FundamentalType.TheBigint, GenericValue, BigintLiteralTypeDefinition> & DKind.Kind<typeof bigintLiteralTypeKind>> {
|
|
10
10
|
}
|
|
11
11
|
export declare const BigintLiteralType: <const GenericBigint extends bigint>(value: GenericBigint) => BigintLiteralType<GenericBigint>;
|
|
@@ -5,6 +5,6 @@ import * as FundamentalType from "../../fundamentalType";
|
|
|
5
5
|
export declare const booleanTypeKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/boolean-type", unknown>>;
|
|
6
6
|
export interface BooleanTypeDefinition extends TypeDefinition {
|
|
7
7
|
}
|
|
8
|
-
export interface BooleanType extends DCommon.
|
|
8
|
+
export interface BooleanType extends DCommon.Forward<Type<FundamentalType.TheBoolean, boolean, BooleanTypeDefinition> & DKind.Kind<typeof booleanTypeKind>> {
|
|
9
9
|
}
|
|
10
10
|
export declare const BooleanType: () => BooleanType;
|
|
@@ -6,6 +6,6 @@ export declare const booleanLiteralTypeKind: DKind.Handler<DKind.Definition<"@Du
|
|
|
6
6
|
export interface BooleanLiteralTypeDefinition extends TypeDefinition {
|
|
7
7
|
value: boolean;
|
|
8
8
|
}
|
|
9
|
-
export interface BooleanLiteralType<GenericValue extends boolean = boolean> extends DCommon.
|
|
9
|
+
export interface BooleanLiteralType<GenericValue extends boolean = boolean> extends DCommon.Forward<Type<FundamentalType.TheBoolean, GenericValue, BooleanLiteralTypeDefinition> & DKind.Kind<typeof booleanLiteralTypeKind>> {
|
|
10
10
|
}
|
|
11
11
|
export declare const BooleanLiteralType: <const GenericBoolean extends boolean>(value: GenericBoolean) => BooleanLiteralType<GenericBoolean>;
|
|
@@ -6,6 +6,6 @@ import * as FundamentalType from "../../fundamentalType";
|
|
|
6
6
|
export declare const dateTypeKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/date-type", unknown>>;
|
|
7
7
|
export interface DateTypeDefinition extends TypeDefinition {
|
|
8
8
|
}
|
|
9
|
-
export interface DateType extends DCommon.
|
|
9
|
+
export interface DateType extends DCommon.Forward<Type<FundamentalType.TheDate, DChrono.TheDate, DateTypeDefinition> & DKind.Kind<typeof dateTypeKind>> {
|
|
10
10
|
}
|
|
11
11
|
export declare const DateType: () => DateType;
|
|
@@ -5,6 +5,6 @@ import * as FundamentalType from "../../fundamentalType";
|
|
|
5
5
|
export declare const nullTypeKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/null-type", unknown>>;
|
|
6
6
|
export interface NullTypeDefinition extends TypeDefinition {
|
|
7
7
|
}
|
|
8
|
-
export interface NullType extends DCommon.
|
|
8
|
+
export interface NullType extends DCommon.Forward<Type<FundamentalType.TheNull, null, NullTypeDefinition> & DKind.Kind<typeof nullTypeKind>> {
|
|
9
9
|
}
|
|
10
10
|
export declare const NullType: () => NullType;
|
|
@@ -5,6 +5,6 @@ import * as FundamentalType from "../../fundamentalType";
|
|
|
5
5
|
export declare const numberTypeKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/number-type", unknown>>;
|
|
6
6
|
export interface NumberTypeDefinition extends TypeDefinition {
|
|
7
7
|
}
|
|
8
|
-
export interface NumberType extends DCommon.
|
|
8
|
+
export interface NumberType extends DCommon.Forward<Type<FundamentalType.TheNumber, number, NumberTypeDefinition> & DKind.Kind<typeof numberTypeKind>> {
|
|
9
9
|
}
|
|
10
10
|
export declare const NumberType: () => NumberType;
|
|
@@ -6,6 +6,6 @@ export declare const numberLiteralTypeKind: DKind.Handler<DKind.Definition<"@Dup
|
|
|
6
6
|
export interface NumberLiteralTypeDefinition extends TypeDefinition {
|
|
7
7
|
value: number;
|
|
8
8
|
}
|
|
9
|
-
export interface NumberLiteralType<GenericValue extends number = number> extends DCommon.
|
|
9
|
+
export interface NumberLiteralType<GenericValue extends number = number> extends DCommon.Forward<Type<FundamentalType.TheNumber, GenericValue, NumberLiteralTypeDefinition> & DKind.Kind<typeof numberLiteralTypeKind>> {
|
|
10
10
|
}
|
|
11
11
|
export declare const NumberLiteralType: <const GenericNumber extends number>(value: GenericNumber) => NumberLiteralType<GenericNumber>;
|
|
@@ -5,6 +5,6 @@ import * as FundamentalType from "../../fundamentalType";
|
|
|
5
5
|
export declare const stringTypeKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/string-type", unknown>>;
|
|
6
6
|
export interface StringTypeDefinition extends TypeDefinition {
|
|
7
7
|
}
|
|
8
|
-
export interface StringType extends DCommon.
|
|
8
|
+
export interface StringType extends DCommon.Forward<Type<FundamentalType.TheString, string, StringTypeDefinition> & DKind.Kind<typeof stringTypeKind>> {
|
|
9
9
|
}
|
|
10
10
|
export declare const StringType: () => StringType;
|
|
@@ -6,6 +6,6 @@ export declare const stringLiteralTypeKind: DKind.Handler<DKind.Definition<"@Dup
|
|
|
6
6
|
export interface StringLiteralTypeDefinition extends TypeDefinition {
|
|
7
7
|
value: string;
|
|
8
8
|
}
|
|
9
|
-
export interface StringLiteralType<GenericValue extends string = string> extends DCommon.
|
|
9
|
+
export interface StringLiteralType<GenericValue extends string = string> extends DCommon.Forward<Type<FundamentalType.TheString, GenericValue, StringLiteralTypeDefinition> & DKind.Kind<typeof stringLiteralTypeKind>> {
|
|
10
10
|
}
|
|
11
11
|
export declare const StringLiteralType: <const GenericString extends string>(value: GenericString) => StringLiteralType<GenericString>;
|
|
@@ -6,6 +6,6 @@ import * as FundamentalType from "../../fundamentalType";
|
|
|
6
6
|
export declare const timeTypeKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/time-type", unknown>>;
|
|
7
7
|
export interface TimeTypeDefinition extends TypeDefinition {
|
|
8
8
|
}
|
|
9
|
-
export interface TimeType extends DCommon.
|
|
9
|
+
export interface TimeType extends DCommon.Forward<Type<FundamentalType.TheTime, DChrono.TheTime, TimeTypeDefinition> & DKind.Kind<typeof timeTypeKind>> {
|
|
10
10
|
}
|
|
11
11
|
export declare const TimeType: () => TimeType;
|
|
@@ -5,6 +5,6 @@ import * as FundamentalType from "../../fundamentalType";
|
|
|
5
5
|
export declare const undefinedTypeKind: DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/undefined-type", unknown>>;
|
|
6
6
|
export interface UndefinedTypeDefinition extends TypeDefinition {
|
|
7
7
|
}
|
|
8
|
-
export interface UndefinedType extends DCommon.
|
|
8
|
+
export interface UndefinedType extends DCommon.Forward<Type<FundamentalType.TheUndefined, undefined, UndefinedTypeDefinition> & DKind.Kind<typeof undefinedTypeKind>> {
|
|
9
9
|
}
|
|
10
10
|
export declare const UndefinedType: () => UndefinedType;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Type } from './base';
|
|
2
|
+
import { Types } from './types';
|
|
3
|
+
import * as DKind from '../../kind';
|
|
2
4
|
export declare const typeIdentifier: {
|
|
3
|
-
<GenericKindHandler extends
|
|
4
|
-
<GenericKindHandler extends
|
|
5
|
+
<GenericKindHandler extends DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/bigint-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/bigint-literal-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/boolean-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/boolean-literal-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/date-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/null-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/number-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/number-literal-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/string-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/string-literal-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/time-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/undefined-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", bigint>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", boolean>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", import('../../chrono').TheDate>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", null>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", number>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", string>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", import('../../chrono').TheTime>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", undefined>>, GenericInput extends unknown, GenericGroupedKind extends GenericKindHandler extends DKind.Handler<DKind.Definition<string, unknown>> ? DKind.Kind<GenericKindHandler, GenericKindHandler["definition"]["value"]> : never>(kind: GenericKindHandler | GenericKindHandler[]): (input: GenericInput) => input is (GenericInput extends Type<import('..').FundamentalType<unknown>, unknown, import('..').TypeDefinition> ? (import('..').BigintType extends infer T ? T extends import('..').BigintType ? T extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').BooleanType extends infer T_1 ? T_1 extends import('..').BooleanType ? T_1 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').DateType extends infer T_2 ? T_2 extends import('..').DateType ? T_2 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').NullType extends infer T_3 ? T_3 extends import('..').NullType ? T_3 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').NumberType extends infer T_4 ? T_4 extends import('..').NumberType ? T_4 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').StringType extends infer T_5 ? T_5 extends import('..').StringType ? T_5 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').TimeType extends infer T_6 ? T_6 extends import('..').TimeType ? T_6 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').UndefinedType extends infer T_7 ? T_7 extends import('..').UndefinedType ? T_7 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').BigintLiteralType<bigint> extends infer T_8 ? T_8 extends import('..').BigintLiteralType<bigint> ? T_8 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').BooleanLiteralType<boolean> extends infer T_9 ? T_9 extends import('..').BooleanLiteralType<boolean> ? T_9 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').NumberLiteralType<number> extends infer T_10 ? T_10 extends import('..').NumberLiteralType<number> ? T_10 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').StringLiteralType<string> extends infer T_11 ? T_11 extends import('..').StringLiteralType<string> ? T_11 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) : never) | Extract<GenericInput, GenericGroupedKind>;
|
|
6
|
+
<GenericKindHandler extends DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/bigint-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/bigint-literal-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/boolean-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/boolean-literal-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/date-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/null-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/number-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/number-literal-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/string-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/string-literal-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/time-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/undefined-type", unknown>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", bigint>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", boolean>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", import('../../chrono').TheDate>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", null>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", number>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", string>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", import('../../chrono').TheTime>> | DKind.Handler<DKind.Definition<"@DuplojsLangDataStructure/type", undefined>>, GenericInput extends unknown, GenericGroupedKind extends GenericKindHandler extends DKind.Handler<DKind.Definition<string, unknown>> ? DKind.Kind<GenericKindHandler, GenericKindHandler["definition"]["value"]> : never>(input: GenericInput, kind: GenericKindHandler | GenericKindHandler[]): input is (GenericInput extends Type<import('..').FundamentalType<unknown>, unknown, import('..').TypeDefinition> ? (import('..').BigintType extends infer T ? T extends import('..').BigintType ? T extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').BooleanType extends infer T_1 ? T_1 extends import('..').BooleanType ? T_1 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').DateType extends infer T_2 ? T_2 extends import('..').DateType ? T_2 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').NullType extends infer T_3 ? T_3 extends import('..').NullType ? T_3 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').NumberType extends infer T_4 ? T_4 extends import('..').NumberType ? T_4 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').StringType extends infer T_5 ? T_5 extends import('..').StringType ? T_5 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').TimeType extends infer T_6 ? T_6 extends import('..').TimeType ? T_6 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').UndefinedType extends infer T_7 ? T_7 extends import('..').UndefinedType ? T_7 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').BigintLiteralType<bigint> extends infer T_8 ? T_8 extends import('..').BigintLiteralType<bigint> ? T_8 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').BooleanLiteralType<boolean> extends infer T_9 ? T_9 extends import('..').BooleanLiteralType<boolean> ? T_9 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').NumberLiteralType<number> extends infer T_10 ? T_10 extends import('..').NumberLiteralType<number> ? T_10 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) | (import('..').StringLiteralType<string> extends infer T_11 ? T_11 extends import('..').StringLiteralType<string> ? T_11 extends GenericInput ? GenericInput & Types extends GenericGroupedKind ? GenericGroupedKind & GenericInput & Types : never : never : never : never) : never) | Extract<GenericInput, GenericGroupedKind>;
|
|
5
7
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -15,6 +15,7 @@ const require_callThen = require("./common/callThen.cjs");
|
|
|
15
15
|
const require_index$1 = require("./object/index.cjs");
|
|
16
16
|
const require_clone = require("./common/clone.cjs");
|
|
17
17
|
const require_index$2 = require("./common/constraint/cast/index.cjs");
|
|
18
|
+
const require_remove = require("./common/constraint/remove.cjs");
|
|
18
19
|
const require_detachObjectMethod = require("./common/detachObjectMethod.cjs");
|
|
19
20
|
const require_enum = require("./common/enum.cjs");
|
|
20
21
|
const require_equal = require("./common/equal.cjs");
|
|
@@ -286,6 +287,7 @@ exports.preparePipe = require_preparePipe.preparePipe;
|
|
|
286
287
|
exports.promiseAll = require_promiseAll.promiseAll;
|
|
287
288
|
exports.promiseObject = require_promiseObject.promiseObject;
|
|
288
289
|
exports.queueKind = require_queue.queueKind;
|
|
290
|
+
exports.removeConstraint = require_remove.removeConstraint;
|
|
289
291
|
exports.shameOnYou = require_index$2.shameOnYou;
|
|
290
292
|
exports.simpleClone = require_simpleClone.simpleClone;
|
|
291
293
|
exports.stringToBytes = require_stringToBytes.stringToBytes;
|
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import { callThen } from "./common/callThen.mjs";
|
|
|
14
14
|
import { object_exports } from "./object/index.mjs";
|
|
15
15
|
import { clone } from "./common/clone.mjs";
|
|
16
16
|
import { cast, shameOnYou } from "./common/constraint/cast/index.mjs";
|
|
17
|
+
import { removeConstraint } from "./common/constraint/remove.mjs";
|
|
17
18
|
import { detachObjectMethod } from "./common/detachObjectMethod.mjs";
|
|
18
19
|
import { createEnum } from "./common/enum.mjs";
|
|
19
20
|
import { equal } from "./common/equal.mjs";
|
|
@@ -67,4 +68,4 @@ import { pattern_exports } from "./pattern/index.mjs";
|
|
|
67
68
|
import { invocation_exports } from "./invocation/index.mjs";
|
|
68
69
|
import { path_exports } from "./path/index.mjs";
|
|
69
70
|
import { printer_exports } from "./printer/index.mjs";
|
|
70
|
-
export { array_exports as A, AssertsError, chrono_exports as C, array_exports as DArray, chrono_exports as DChrono, common_exports as DCommon, dataStructure_exports as DDataStructure, either_exports as DEither, generator_exports as DGenerator, invocation_exports as DInvocation, kind_exports as DKind, modeling_exports as DModeling, number_exports as DNumber, object_exports as DObject, path_exports as DPath, pattern_exports as DPattern, printer_exports as DPrinter, dataStructure_exports as DS, string_exports as DString, tuple_exports as DTuple, either_exports as E, generator_exports as G, invocation_exports as I, InvalidBytesInStringError, InvalidMillisecondInStringError, modeling_exports as M, MissingBuilderMethodsError, number_exports as N, object_exports as O, pattern_exports as P, string_exports as S, tuple_exports as T, TheFormData, and, asserts, asyncInnerPipe, asyncLoop, asyncPipe, bindPrototypeMethods, builderKind, callThen, cast, clone, 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, shameOnYou, simpleClone, stringToBytes, stringToMillisecond, timeout, toCurriedPredicate, toJSON, toNative, toRegExp, transformer, truthy, useAsyncRetry, when, whenElse, whenNot };
|
|
71
|
+
export { array_exports as A, AssertsError, chrono_exports as C, array_exports as DArray, chrono_exports as DChrono, common_exports as DCommon, dataStructure_exports as DDataStructure, either_exports as DEither, generator_exports as DGenerator, invocation_exports as DInvocation, kind_exports as DKind, modeling_exports as DModeling, number_exports as DNumber, object_exports as DObject, path_exports as DPath, pattern_exports as DPattern, printer_exports as DPrinter, dataStructure_exports as DS, string_exports as DString, tuple_exports as DTuple, either_exports as E, generator_exports as G, invocation_exports as I, InvalidBytesInStringError, InvalidMillisecondInStringError, modeling_exports as M, MissingBuilderMethodsError, number_exports as N, object_exports as O, pattern_exports as P, string_exports as S, tuple_exports as T, TheFormData, and, asserts, asyncInnerPipe, asyncLoop, asyncPipe, bindPrototypeMethods, builderKind, callThen, cast, clone, 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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FlowControllerExit, FlowControllerResult, flowControllerExitKind, FlowControllerPreviousFunctionResult, UnwrapFlowControllerResult } from './controller';
|
|
2
|
-
import { DKind } from '../../index.ts';
|
|
3
2
|
import * as DCommon from '../../common';
|
|
3
|
+
import type * as DKind from '../../kind';
|
|
4
4
|
type ComputeLastUsableValue<GenericAccumulator extends DCommon.AnyTuple> = GenericAccumulator extends [
|
|
5
5
|
...infer InferredRest,
|
|
6
6
|
infer InferredLast
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_parentClass = require("../../../../kind/parentClass.cjs");
|
|
2
2
|
const require_create = require("../../../../either/left/create.cjs");
|
|
3
|
+
const require_stringToMillisecond = require("../../../../common/stringToMillisecond.cjs");
|
|
3
4
|
const require_kind = require("../../../kind.cjs");
|
|
4
5
|
const require_base = require("../base.cjs");
|
|
5
6
|
//#region scripts/invocation/flow/controller/defaults/aborter.ts
|
|
@@ -11,14 +12,16 @@ var AbortErrorFlowController = class extends require_parentClass.parentClass(req
|
|
|
11
12
|
this.abortController = abortController;
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
|
-
const aborter = require_base.createFlowController(flowControllerAborterKind, ({ init, exitFlow }) => (theFunction) => {
|
|
15
|
+
const aborter = require_base.createFlowController(flowControllerAborterKind, ({ init, exitFlow }) => (theFunction, params) => {
|
|
15
16
|
let aborter = void 0;
|
|
17
|
+
const formattedTimeout = params?.timeout === void 0 ? void 0 : require_stringToMillisecond.stringToMillisecond(params.timeout);
|
|
16
18
|
return init(async (previousFunction) => {
|
|
17
19
|
const result = previousFunction();
|
|
18
20
|
if (require_base.flowControllerExitKind.has(result)) return result;
|
|
19
21
|
aborter?.abort(new AbortErrorFlowController(aborter));
|
|
20
22
|
const currentAborter = new AbortController();
|
|
21
23
|
aborter = currentAborter;
|
|
24
|
+
if (formattedTimeout !== void 0) setTimeout(() => void currentAborter.abort(new AbortErrorFlowController(currentAborter)), formattedTimeout);
|
|
22
25
|
try {
|
|
23
26
|
const abortResult = await theFunction(result, currentAborter);
|
|
24
27
|
if (currentAborter.signal.aborted === true) return exitFlow(require_create.left("signal-aborted", currentAborter.signal.reason));
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { FlowController } from '../base';
|
|
2
|
-
import
|
|
2
|
+
import * as DCommon from '../../../../common';
|
|
3
3
|
import * as DKind from '../../../../kind';
|
|
4
4
|
import * as DEither from '../../../../either';
|
|
5
5
|
export declare const flowControllerAborterKind: DKind.Handler<DKind.Definition<"@DuplojsLangInvocation/flow-controller-aborter", unknown>>;
|
|
6
|
-
export interface FlowControllerAborter<GenericInput extends unknown = unknown, GenericOutput extends unknown = unknown> extends DCommon.
|
|
6
|
+
export interface FlowControllerAborter<GenericInput extends unknown = unknown, GenericOutput extends unknown = unknown> extends DCommon.Forward<FlowController<GenericInput, Promise<Awaited<GenericOutput> | DEither.Left<"signal-aborted", AbortErrorFlowController>>> & DKind.Kind<typeof flowControllerAborterKind>> {
|
|
7
7
|
}
|
|
8
8
|
declare const AbortErrorFlowController_base: DKind.KindClass<DKind.Handler<DKind.Definition<"@DuplojsLangInvocation/abort-error-flow-controller", unknown>>, ErrorConstructor>;
|
|
9
9
|
export declare class AbortErrorFlowController extends AbortErrorFlowController_base {
|
|
10
10
|
abortController: AbortController;
|
|
11
11
|
constructor(abortController: AbortController);
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export interface FlowControllerAborterParams {
|
|
14
|
+
timeout?: DCommon.TimeInString;
|
|
15
|
+
}
|
|
16
|
+
export declare const aborter: <GenericInput extends unknown, GenericOutput extends unknown>(theFunction: (input: GenericInput, aborter: AbortController) => GenericOutput, params?: FlowControllerAborterParams) => FlowControllerAborter<GenericInput, GenericOutput>;
|
|
14
17
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parentClass } from "../../../../kind/parentClass.mjs";
|
|
2
2
|
import { left } from "../../../../either/left/create.mjs";
|
|
3
|
+
import { stringToMillisecond } from "../../../../common/stringToMillisecond.mjs";
|
|
3
4
|
import { createKind } from "../../../kind.mjs";
|
|
4
5
|
import { createFlowController, flowControllerExitKind } from "../base.mjs";
|
|
5
6
|
//#region scripts/invocation/flow/controller/defaults/aborter.ts
|
|
@@ -11,14 +12,16 @@ var AbortErrorFlowController = class extends parentClass(createKind("abort-error
|
|
|
11
12
|
this.abortController = abortController;
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
|
-
const aborter = createFlowController(flowControllerAborterKind, ({ init, exitFlow }) => (theFunction) => {
|
|
15
|
+
const aborter = createFlowController(flowControllerAborterKind, ({ init, exitFlow }) => (theFunction, params) => {
|
|
15
16
|
let aborter = void 0;
|
|
17
|
+
const formattedTimeout = params?.timeout === void 0 ? void 0 : stringToMillisecond(params.timeout);
|
|
16
18
|
return init(async (previousFunction) => {
|
|
17
19
|
const result = previousFunction();
|
|
18
20
|
if (flowControllerExitKind.has(result)) return result;
|
|
19
21
|
aborter?.abort(new AbortErrorFlowController(aborter));
|
|
20
22
|
const currentAborter = new AbortController();
|
|
21
23
|
aborter = currentAborter;
|
|
24
|
+
if (formattedTimeout !== void 0) setTimeout(() => void currentAborter.abort(new AbortErrorFlowController(currentAborter)), formattedTimeout);
|
|
22
25
|
try {
|
|
23
26
|
const abortResult = await theFunction(result, currentAborter);
|
|
24
27
|
if (currentAborter.signal.aborted === true) return exitFlow(left("signal-aborted", currentAborter.signal.reason));
|
|
@@ -3,6 +3,6 @@ import * as DCommon from '../../../../common';
|
|
|
3
3
|
import type * as DKind from '../../../../kind';
|
|
4
4
|
import * as DEither from '../../../../either';
|
|
5
5
|
export declare const flowControllerDebounceKind: DKind.Handler<DKind.Definition<"@DuplojsLangInvocation/flow-controller-debounce", unknown>>;
|
|
6
|
-
export interface FlowControllerDebounce<GenericInput extends unknown = unknown> extends DCommon.
|
|
6
|
+
export interface FlowControllerDebounce<GenericInput extends unknown = unknown> extends DCommon.Forward<FlowController<GenericInput, Promise<FlowControllerExit<DEither.Left<"debounce-reject">>>> & DKind.Kind<typeof flowControllerDebounceKind>> {
|
|
7
7
|
}
|
|
8
8
|
export declare const debounce: <GenericInput extends unknown = unknown>(debounce: DCommon.TimeInString) => FlowControllerDebounce<GenericInput>;
|
|
@@ -3,6 +3,6 @@ import * as DCommon from '../../../../common';
|
|
|
3
3
|
import type * as DKind from '../../../../kind';
|
|
4
4
|
import * as DEither from '../../../../either';
|
|
5
5
|
export declare const flowControllerFilterKind: DKind.Handler<DKind.Definition<"@DuplojsLangInvocation/flow-controller-filter", unknown>>;
|
|
6
|
-
export interface FlowControllerFilter<GenericInput extends unknown = unknown, GenericOutput extends unknown = unknown> extends DCommon.
|
|
6
|
+
export interface FlowControllerFilter<GenericInput extends unknown = unknown, GenericOutput extends unknown = unknown> extends DCommon.Forward<FlowController<GenericInput, DCommon.SplitPromise<GenericOutput> extends infer InferredOutput ? InferredOutput extends unknown ? Awaited<InferredOutput> extends infer InferredAwaited ? (InferredAwaited extends DEither.Left ? FlowControllerExit<InferredAwaited> : InferredAwaited extends DEither.Right ? DEither.GetValue<InferredAwaited> : InferredAwaited) extends infer InferredResult ? InferredOutput extends Promise<unknown> ? Promise<InferredResult> : InferredResult : never : never : never : never> & DKind.Kind<typeof flowControllerFilterKind>> {
|
|
7
7
|
}
|
|
8
8
|
export declare const filter: <GenericInput extends unknown, GenericOutput extends unknown>(filterFunction: (input: GenericInput) => GenericOutput) => FlowControllerFilter<GenericInput, GenericOutput>;
|
|
@@ -2,7 +2,7 @@ import { FlowController } from '../base';
|
|
|
2
2
|
import * as DCommon from '../../../../common';
|
|
3
3
|
import type * as DKind from '../../../../kind';
|
|
4
4
|
export declare const flowControllerRetryKind: DKind.Handler<DKind.Definition<"@DuplojsLangInvocation/flow-controller-retry", unknown>>;
|
|
5
|
-
export interface FlowControllerRetry<GenericInput extends unknown = unknown> extends DCommon.
|
|
5
|
+
export interface FlowControllerRetry<GenericInput extends unknown = unknown> extends DCommon.Forward<FlowController<GenericInput, Promise<never>> & DKind.Kind<typeof flowControllerRetryKind>> {
|
|
6
6
|
}
|
|
7
7
|
export interface RetryParams {
|
|
8
8
|
times?: number;
|
|
@@ -3,6 +3,6 @@ import * as DCommon from '../../../../common';
|
|
|
3
3
|
import type * as DKind from '../../../../kind';
|
|
4
4
|
import * as DEither from '../../../../either';
|
|
5
5
|
export declare const flowControllerThrottlingKind: DKind.Handler<DKind.Definition<"@DuplojsLangInvocation/flow-controller-throttling", unknown>>;
|
|
6
|
-
export interface FlowControllerThrottling<GenericInput extends unknown = unknown> extends DCommon.
|
|
6
|
+
export interface FlowControllerThrottling<GenericInput extends unknown = unknown> extends DCommon.Forward<FlowController<GenericInput, Promise<FlowControllerExit<DEither.Left<"throttling-reject">>>> & DKind.Kind<typeof flowControllerThrottlingKind>> {
|
|
7
7
|
}
|
|
8
8
|
export declare const throttling: <GenericInput extends unknown = unknown>(throttling: DCommon.TimeInString) => FlowControllerThrottling<GenericInput>;
|
|
@@ -2,6 +2,6 @@ import { FlowController } from '../base';
|
|
|
2
2
|
import * as DCommon from '../../../../common';
|
|
3
3
|
import type * as DKind from '../../../../kind';
|
|
4
4
|
export declare const flowControllerTimeoutKind: DKind.Handler<DKind.Definition<"@DuplojsLangInvocation/flow-controller-timeout", unknown>>;
|
|
5
|
-
export interface FlowControllerTimeout<GenericInput extends unknown = unknown> extends DCommon.
|
|
5
|
+
export interface FlowControllerTimeout<GenericInput extends unknown = unknown> extends DCommon.Forward<FlowController<GenericInput, Promise<never>> & DKind.Kind<typeof flowControllerTimeoutKind>> {
|
|
6
6
|
}
|
|
7
7
|
export declare const timeout: <GenericInput extends unknown = unknown>(timeout: DCommon.TimeInString) => FlowControllerTimeout<GenericInput>;
|
|
@@ -2,6 +2,6 @@ import { Kind, Handler } from './base';
|
|
|
2
2
|
import { GetHandler } from './types';
|
|
3
3
|
import type * as DCommon from '../common';
|
|
4
4
|
export declare function createKindIdentifier<GenericParent extends Kind<Handler>, GenericChildren extends GenericParent>(): {
|
|
5
|
-
<GenericKindHandler extends GenericChildren extends infer InferredChildren ? InferredChildren extends GenericParent ? GetHandler<InferredChildren> : never : never, GenericInput extends unknown, GenericGroupedKind extends DCommon.
|
|
6
|
-
<GenericKindHandler extends GenericChildren extends infer InferredChildren ? InferredChildren extends GenericParent ? GetHandler<InferredChildren> : never : never, GenericInput extends unknown, GenericGroupedKind extends DCommon.
|
|
5
|
+
<GenericKindHandler extends GenericChildren extends infer InferredChildren ? InferredChildren extends GenericParent ? GetHandler<InferredChildren> : never : never, GenericInput extends unknown, GenericGroupedKind extends DCommon.Forward<GenericKindHandler extends Handler ? Kind<GenericKindHandler> : never>>(kind: GenericKindHandler | GenericKindHandler[]): (input: GenericInput) => input is ((GenericInput extends GenericParent ? GenericChildren extends GenericInput ? GenericChildren extends GenericGroupedKind ? GenericChildren : never : never : never) | Extract<GenericInput, GenericGroupedKind>);
|
|
6
|
+
<GenericKindHandler extends GenericChildren extends infer InferredChildren ? InferredChildren extends GenericParent ? GetHandler<InferredChildren> : never : never, GenericInput extends unknown, GenericGroupedKind extends DCommon.Forward<GenericKindHandler extends Handler ? Kind<GenericKindHandler> : never>>(input: GenericInput, kind: GenericKindHandler | GenericKindHandler[]): input is ((GenericInput extends GenericParent ? GenericChildren extends GenericInput ? GenericChildren extends GenericGroupedKind ? GenericChildren : never : never : never) | Extract<GenericInput, GenericGroupedKind>);
|
|
7
7
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Codecs, EncodedValue } from '../../dataStructure/common';
|
|
2
1
|
import { NewType, NewTypeMap } from '../newType';
|
|
3
2
|
import type * as DKind from '../../kind';
|
|
4
3
|
import * as DCommon from '../../common';
|
|
@@ -10,9 +9,9 @@ declare module '../../dataStructure' {
|
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
11
|
declare module '../../dataStructure/common' {
|
|
13
|
-
interface EncodeStructure<GenericValue extends unknown, GenericCodecs extends Codecs> {
|
|
12
|
+
interface EncodeStructure<GenericValue extends unknown, GenericCodecs extends DDataStructure.Codecs> {
|
|
14
13
|
entity: GenericValue extends Entity<infer InferredName> ? (Entity<InferredName> & {
|
|
15
|
-
[Prop in Exclude<keyof GenericValue, DKind.KeySymbol>]: EncodedValue<GenericValue[Prop], GenericCodecs>;
|
|
14
|
+
[Prop in Exclude<keyof GenericValue, DKind.KeySymbol>]: DDataStructure.EncodedValue<GenericValue[Prop], GenericCodecs>;
|
|
16
15
|
}) : never;
|
|
17
16
|
}
|
|
18
17
|
}
|
|
@@ -34,7 +33,7 @@ export type EntityMap<GenericValue extends unknown, GenericRawValue = DCommon.Re
|
|
|
34
33
|
]> extends true ? {
|
|
35
34
|
[Prop in keyof GenericRawValue]: NewTypeMap<GenericRawValue[Prop]>;
|
|
36
35
|
} : GenericRawValue : GenericRawValue;
|
|
37
|
-
export interface EntityStructure<GenericName extends string = string, GenericProperties extends Record<string, unknown> = Record<string, unknown>> extends DCommon.
|
|
36
|
+
export interface EntityStructure<GenericName extends string = string, GenericProperties extends Record<string, unknown> = Record<string, unknown>> extends DCommon.Forward<DDataStructure.Structure<Entity<GenericName> & GenericProperties, EntityStructureDefinition> & DKind.Kind<typeof entityStructureKind>> {
|
|
38
37
|
readonly name: GenericName;
|
|
39
38
|
"new"<GenericNewProperties extends GenericProperties>(properties: GenericNewProperties): (Entity<GenericName> & GenericNewProperties);
|
|
40
39
|
decodeMap<GenericCodecs extends DDataStructure.Codecs>(codecs: GenericCodecs): (data: DDataStructure.EncodedValue<EntityMap<DKind.Remove<DDataStructure.StructureValue<this>>>, GenericCodecs>) => (DEither.Right<"map-success", DDataStructure.StructureValue<this>> | DEither.Left<"async-error", undefined> | DEither.Left<"map-error", DDataStructure.Error>);
|
|
@@ -25,7 +25,7 @@ export interface NewTypeStructureDefinition<GenericNewTypeConstraint extends rea
|
|
|
25
25
|
readonly newTypeConstraints: GenericNewTypeConstraint;
|
|
26
26
|
}
|
|
27
27
|
export type ComputeNewType<GenericName extends string, GenericValue extends unknown, GenericNewTypeConstraint extends readonly DDataStructure.Constraint<GenericValue>[], GenericIntersectionConstraintValue = DDataStructure.ConstraintValue<DArray.Unwrap<GenericNewTypeConstraint>>, GenericClearValue = DCommon.NeverCoalescing<DCommon.RemoveConstraint<GenericIntersectionConstraintValue>, unknown>> = (GenericValue & GenericClearValue & NewType<GenericName, GenericIntersectionConstraintValue extends (GenericClearValue & infer InferredConstraint extends DCommon.BaseConstraint) ? InferredConstraint : never>);
|
|
28
|
-
export interface NewTypeStructure<GenericName extends string = string, GenericValue extends unknown = unknown, GenericNewTypeConstraint extends readonly DDataStructure.Constraint<GenericValue>[] = readonly DDataStructure.Constraint<GenericValue>[]> extends DCommon.
|
|
28
|
+
export interface NewTypeStructure<GenericName extends string = string, GenericValue extends unknown = unknown, GenericNewTypeConstraint extends readonly DDataStructure.Constraint<GenericValue>[] = readonly DDataStructure.Constraint<GenericValue>[]> extends DCommon.Forward<DDataStructure.Structure<ComputeNewType<GenericName, GenericValue, GenericNewTypeConstraint>, NewTypeStructureDefinition<GenericNewTypeConstraint>> & DKind.Kind<typeof newTypeStructureKind>> {
|
|
29
29
|
readonly name: GenericName;
|
|
30
30
|
decodeMap<GenericCodecs extends DDataStructure.Codecs>(codecs: GenericCodecs): (data: DDataStructure.EncodedValue<NewTypeMap<DDataStructure.StructureValue<this>>, GenericCodecs>) => (DEither.Right<"map-success", DDataStructure.StructureValue<this>> | DEither.Left<"async-error", undefined> | DEither.Left<"map-error", DDataStructure.Error>);
|
|
31
31
|
decodeMap<GenericCodecs extends DDataStructure.Codecs>(codecs: GenericCodecs, data: DDataStructure.EncodedValue<NewTypeMap<DDataStructure.StructureValue<this>>, GenericCodecs>): (DEither.Right<"map-success", DDataStructure.StructureValue<this>> | DEither.Left<"async-error", undefined> | DEither.Left<"map-error", DDataStructure.Error>);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Codecs, EncodedValue } from '../../dataStructure/common';
|
|
2
1
|
import type * as DKind from '../../kind';
|
|
3
2
|
import type * as DCommon from '../../common';
|
|
4
3
|
import * as DDataStructure from '../../dataStructure';
|
|
@@ -8,9 +7,9 @@ declare module '../../dataStructure' {
|
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
9
|
declare module '../../dataStructure/common' {
|
|
11
|
-
interface EncodeStructure<GenericValue extends unknown, GenericCodecs extends Codecs> {
|
|
10
|
+
interface EncodeStructure<GenericValue extends unknown, GenericCodecs extends DDataStructure.Codecs> {
|
|
12
11
|
taggedObject: GenericValue extends ObjectTag<infer InferredName> ? (ObjectTag<InferredName> & {
|
|
13
|
-
[Prop in Exclude<keyof GenericValue, DKind.KeySymbol>]: EncodedValue<GenericValue[Prop], GenericCodecs>;
|
|
12
|
+
[Prop in Exclude<keyof GenericValue, DKind.KeySymbol>]: DDataStructure.EncodedValue<GenericValue[Prop], GenericCodecs>;
|
|
14
13
|
}) : never;
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -26,7 +25,7 @@ export declare const taggedObjectStructureKind: DKind.Handler<DKind.Definition<"
|
|
|
26
25
|
export interface TaggedObjectStructureDefinition extends DDataStructure.StructureDefinition<readonly []> {
|
|
27
26
|
readonly inner: DDataStructure.ObjectStructure;
|
|
28
27
|
}
|
|
29
|
-
export interface TaggedObjectStructure<GenericTaggedObject extends ObjectTag = ObjectTag> extends DCommon.
|
|
28
|
+
export interface TaggedObjectStructure<GenericTaggedObject extends ObjectTag = ObjectTag> extends DCommon.Forward<DDataStructure.Structure<GenericTaggedObject, TaggedObjectStructureDefinition> & DKind.Kind<typeof taggedObjectStructureKind>> {
|
|
30
29
|
readonly name: GetTagValue<GenericTaggedObject>;
|
|
31
30
|
}
|
|
32
31
|
export declare const TaggedObjectStructure: <GenericTaggedObject extends ObjectTag, GenericName extends string = never, GenericShape extends DDataStructure.ShapeObjectStructure = never>(name: GetTagValue<GenericTaggedObject> | GenericName, shape: ShapeTaggedObjectStructure<GenericTaggedObject> | GenericShape) => TaggedObjectStructure<ObjectTag extends GenericTaggedObject ? (ObjectTag<GenericName> & DDataStructure.ShapeObjectStructureValue<GenericShape>) : GenericTaggedObject>;
|
package/dist/string/isUrl.cjs
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
//#region scripts/string/isUrl.ts
|
|
2
|
-
|
|
3
|
-
function isUrl(string, params) {
|
|
2
|
+
function isUrl(string) {
|
|
4
3
|
try {
|
|
5
|
-
|
|
6
|
-
if (params?.hostname) {
|
|
7
|
-
params.hostname.lastIndex = 0;
|
|
8
|
-
if (!params.hostname.test(url.hostname)) return false;
|
|
9
|
-
}
|
|
10
|
-
if (params?.protocol) {
|
|
11
|
-
params.protocol.lastIndex = 0;
|
|
12
|
-
if (!params.protocol.test(url.protocol.replace(regexRemoveDote, ""))) return false;
|
|
13
|
-
}
|
|
4
|
+
new URL(string);
|
|
14
5
|
return true;
|
|
15
6
|
} catch {
|
|
16
7
|
return false;
|
package/dist/string/isUrl.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
import { Url } from './constraints';
|
|
2
|
-
export
|
|
3
|
-
hostname?: RegExp;
|
|
4
|
-
protocol?: RegExp;
|
|
5
|
-
}
|
|
6
|
-
export declare function isUrl<GenericValue extends string>(string: GenericValue, params?: IsUrlParams): string is GenericValue & Url;
|
|
2
|
+
export declare function isUrl<GenericValue extends string>(string: GenericValue): string is GenericValue & Url;
|
package/dist/string/isUrl.mjs
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
//#region scripts/string/isUrl.ts
|
|
2
|
-
|
|
3
|
-
function isUrl(string, params) {
|
|
2
|
+
function isUrl(string) {
|
|
4
3
|
try {
|
|
5
|
-
|
|
6
|
-
if (params?.hostname) {
|
|
7
|
-
params.hostname.lastIndex = 0;
|
|
8
|
-
if (!params.hostname.test(url.hostname)) return false;
|
|
9
|
-
}
|
|
10
|
-
if (params?.protocol) {
|
|
11
|
-
params.protocol.lastIndex = 0;
|
|
12
|
-
if (!params.protocol.test(url.protocol.replace(regexRemoveDote, ""))) return false;
|
|
13
|
-
}
|
|
4
|
+
new URL(string);
|
|
14
5
|
return true;
|
|
15
6
|
} catch {
|
|
16
7
|
return false;
|