@duplojs/lang 0.0.1-beta.7 → 0.0.1-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chrono/createDate.cjs +8 -8
- package/dist/chrono/createDate.d.ts +3 -3
- package/dist/chrono/createDate.mjs +8 -8
- package/dist/chrono/createTime.cjs +24 -13
- package/dist/chrono/createTime.mjs +24 -13
- package/dist/chrono/theDate.cjs +15 -16
- package/dist/chrono/theDate.d.ts +15 -15
- package/dist/chrono/theDate.mjs +15 -16
- package/dist/chrono/theTime.cjs +0 -1
- package/dist/chrono/theTime.mjs +0 -1
- package/dist/chrono/types/spoolingTime.d.ts +2 -1
- package/dist/common/constraint/cast/string.d.ts +4 -0
- package/dist/common/constraint/infer/string.d.ts +1 -0
- package/dist/common/isType.d.ts +3 -2
- package/dist/dataStructure/common/{codec.cjs → codec/base.cjs} +5 -5
- package/dist/dataStructure/common/{codec.d.ts → codec/base.d.ts} +6 -6
- package/dist/dataStructure/common/{codec.mjs → codec/base.mjs} +5 -5
- package/dist/dataStructure/common/codec/defaults/index.d.ts +2 -0
- package/dist/dataStructure/common/codec/defaults/json.cjs +26 -0
- package/dist/dataStructure/common/codec/defaults/json.d.ts +6 -0
- package/dist/dataStructure/common/codec/defaults/json.mjs +26 -0
- package/dist/dataStructure/common/codec/defaults/string.cjs +44 -0
- package/dist/dataStructure/common/codec/defaults/string.d.ts +11 -0
- package/dist/dataStructure/common/codec/defaults/string.mjs +44 -0
- package/dist/dataStructure/common/codec/index.d.ts +2 -0
- package/dist/dataStructure/constraint/defaults/index.d.ts +1 -0
- package/dist/dataStructure/constraint/defaults/numberInString.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/numberInString.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/numberInString.mjs +12 -0
- package/dist/dataStructure/constraint/types/constraints.d.ts +1 -0
- package/dist/dataStructure/helpers/index.d.ts +1 -0
- package/dist/dataStructure/helpers/numberInString.cjs +7 -0
- package/dist/dataStructure/helpers/numberInString.d.ts +2 -0
- package/dist/dataStructure/helpers/numberInString.mjs +7 -0
- package/dist/dataStructure/index.cjs +65 -51
- package/dist/dataStructure/index.mjs +21 -12
- package/dist/number/types/isGreater.d.ts +5 -5
- package/dist/string/constraints/index.d.ts +2 -1
- package/dist/string/constraints/number.d.ts +4 -0
- package/dist/string/index.cjs +3 -0
- package/dist/string/index.d.ts +1 -0
- package/dist/string/index.mjs +3 -1
- package/dist/string/isNumber.cjs +7 -0
- package/dist/string/isNumber.d.ts +5 -0
- package/dist/string/isNumber.mjs +7 -0
- package/dist/string/to.d.ts +9 -2
- package/dist/string/types/index.d.ts +4 -5
- package/dist/string/types/numberInString.d.ts +1 -0
- package/package.json +1 -1
- package/dist/string/types/number.d.ts +0 -1
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { createKind } from "./kind.mjs";
|
|
3
3
|
import { ErrorSymbol, SuccessSymbol } from "./common/resultSymbol.mjs";
|
|
4
|
-
import { codecKind, codecsKind, createCodec, createCodecs } from "./common/codec.mjs";
|
|
4
|
+
import { codecKind, codecsKind, createCodec, createCodecs } from "./common/codec/base.mjs";
|
|
5
|
+
import { createFundamentalType, fundamentalTypeKind } from "./fundamentalType/base.mjs";
|
|
6
|
+
import { TheBigint, bigintFundamentalTypeKind } from "./fundamentalType/defaults/bigint.mjs";
|
|
7
|
+
import { TheBoolean, booleanFundamentalTypeKind } from "./fundamentalType/defaults/boolean.mjs";
|
|
8
|
+
import { TheDate, dateFundamentalTypeKind } from "./fundamentalType/defaults/date.mjs";
|
|
9
|
+
import { TheNull, nullFundamentalTypeKind } from "./fundamentalType/defaults/null.mjs";
|
|
10
|
+
import { TheNumber, numberFundamentalTypeKind } from "./fundamentalType/defaults/number.mjs";
|
|
11
|
+
import { TheString, stringFundamentalTypeKind } from "./fundamentalType/defaults/string.mjs";
|
|
12
|
+
import { TheTime, timeFundamentalTypeKind } from "./fundamentalType/defaults/time.mjs";
|
|
13
|
+
import { TheUndefined, undefinedFundamentalTypeKind } from "./fundamentalType/defaults/undefined.mjs";
|
|
14
|
+
import { fundamentalTypeIdentifier } from "./fundamentalType/identifier.mjs";
|
|
15
|
+
import { codecsJson } from "./common/codec/defaults/json.mjs";
|
|
16
|
+
import { codecsString } from "./common/codec/defaults/string.mjs";
|
|
5
17
|
import { createErrorHandler, createGetErrorHandler, decodeIssueKind, encodeIssueKind, issueKind } from "./common/error.mjs";
|
|
6
18
|
import { createErrorInterpreter } from "./common/errorInterpreter.mjs";
|
|
7
19
|
import { ConstraintBase, constraintKind, createConstraint } from "./constraint/base.mjs";
|
|
@@ -25,6 +37,7 @@ import { MultipleOfConstraint, multipleOfConstraintKind } from "./constraint/def
|
|
|
25
37
|
import { NegativeConstraint, negativeConstraintKind } from "./constraint/defaults/negative.mjs";
|
|
26
38
|
import { NotEmptyConstraint, notEmptyConstraintKind } from "./constraint/defaults/notEmpty.mjs";
|
|
27
39
|
import { NotZeroConstraint, notZeroConstraintKind } from "./constraint/defaults/notZero.mjs";
|
|
40
|
+
import { NumberInStringConstraint, numberInStringConstraintKind } from "./constraint/defaults/numberInString.mjs";
|
|
28
41
|
import { OddConstraint, oddConstraintKind } from "./constraint/defaults/odd.mjs";
|
|
29
42
|
import { PathConstraint, pathConstraintKind } from "./constraint/defaults/path.mjs";
|
|
30
43
|
import { PositiveConstraint, positiveConstraintKind } from "./constraint/defaults/positive.mjs";
|
|
@@ -39,16 +52,6 @@ import { UrlConstraint, urlConstraintKind } from "./constraint/defaults/url.mjs"
|
|
|
39
52
|
import { UuidConstraint, uuidConstraintKind } from "./constraint/defaults/uuid.mjs";
|
|
40
53
|
import { RegexConstraint, regexConstraintKind } from "./constraint/defaults/regex.mjs";
|
|
41
54
|
import { constraintIdentifier } from "./constraint/identifier.mjs";
|
|
42
|
-
import { createFundamentalType, fundamentalTypeKind } from "./fundamentalType/base.mjs";
|
|
43
|
-
import { TheBigint, bigintFundamentalTypeKind } from "./fundamentalType/defaults/bigint.mjs";
|
|
44
|
-
import { TheBoolean, booleanFundamentalTypeKind } from "./fundamentalType/defaults/boolean.mjs";
|
|
45
|
-
import { TheDate, dateFundamentalTypeKind } from "./fundamentalType/defaults/date.mjs";
|
|
46
|
-
import { TheNull, nullFundamentalTypeKind } from "./fundamentalType/defaults/null.mjs";
|
|
47
|
-
import { TheNumber, numberFundamentalTypeKind } from "./fundamentalType/defaults/number.mjs";
|
|
48
|
-
import { TheString, stringFundamentalTypeKind } from "./fundamentalType/defaults/string.mjs";
|
|
49
|
-
import { TheTime, timeFundamentalTypeKind } from "./fundamentalType/defaults/time.mjs";
|
|
50
|
-
import { TheUndefined, undefinedFundamentalTypeKind } from "./fundamentalType/defaults/undefined.mjs";
|
|
51
|
-
import { fundamentalTypeIdentifier } from "./fundamentalType/identifier.mjs";
|
|
52
55
|
import { absolutePath } from "./helpers/absolutePath.mjs";
|
|
53
56
|
import { allowedCharacters } from "./helpers/allowedCharacters.mjs";
|
|
54
57
|
import { StructureClass, createStructure, structureKind } from "./structure/base.mjs";
|
|
@@ -105,6 +108,7 @@ import { notZero } from "./helpers/notZero.mjs";
|
|
|
105
108
|
import { null as nullHelper } from "./helpers/null.mjs";
|
|
106
109
|
import { nullable } from "./helpers/nullable.mjs";
|
|
107
110
|
import { number } from "./helpers/number.mjs";
|
|
111
|
+
import { numberInString } from "./helpers/numberInString.mjs";
|
|
108
112
|
import { object } from "./helpers/object.mjs";
|
|
109
113
|
import { odd } from "./helpers/odd.mjs";
|
|
110
114
|
import { undefined as undefinedHelper } from "./helpers/undefined.mjs";
|
|
@@ -159,6 +163,7 @@ var dataStructure_exports = /* @__PURE__ */ __exportAll({
|
|
|
159
163
|
NotEmptyConstraint: () => NotEmptyConstraint,
|
|
160
164
|
NotZeroConstraint: () => NotZeroConstraint,
|
|
161
165
|
NullType: () => NullType,
|
|
166
|
+
NumberInStringConstraint: () => NumberInStringConstraint,
|
|
162
167
|
NumberLiteralType: () => NumberLiteralType,
|
|
163
168
|
NumberType: () => NumberType,
|
|
164
169
|
ObjectStructure: () => ObjectStructure,
|
|
@@ -213,7 +218,9 @@ var dataStructure_exports = /* @__PURE__ */ __exportAll({
|
|
|
213
218
|
booleanLiteralTypeKind: () => booleanLiteralTypeKind,
|
|
214
219
|
booleanTypeKind: () => booleanTypeKind,
|
|
215
220
|
codecKind: () => codecKind,
|
|
221
|
+
codecsJson: () => codecsJson,
|
|
216
222
|
codecsKind: () => codecsKind,
|
|
223
|
+
codecsString: () => codecsString,
|
|
217
224
|
constraintIdentifier: () => constraintIdentifier,
|
|
218
225
|
constraintKind: () => constraintKind,
|
|
219
226
|
createCodec: () => createCodec,
|
|
@@ -277,6 +284,8 @@ var dataStructure_exports = /* @__PURE__ */ __exportAll({
|
|
|
277
284
|
nullable: () => nullable,
|
|
278
285
|
number: () => number,
|
|
279
286
|
numberFundamentalTypeKind: () => numberFundamentalTypeKind,
|
|
287
|
+
numberInString: () => numberInString,
|
|
288
|
+
numberInStringConstraintKind: () => numberInStringConstraintKind,
|
|
280
289
|
numberLiteralTypeKind: () => numberLiteralTypeKind,
|
|
281
290
|
numberTypeKind: () => numberTypeKind,
|
|
282
291
|
object: () => object,
|
|
@@ -331,4 +340,4 @@ var dataStructure_exports = /* @__PURE__ */ __exportAll({
|
|
|
331
340
|
uuidConstraintKind: () => uuidConstraintKind
|
|
332
341
|
});
|
|
333
342
|
//#endregion
|
|
334
|
-
export { AbsolutePathConstraint, AllowedCharactersConstraint, ArrayLengthEqualConstraint, ArrayStructure, BetweenThanConstraint, BetweenThanOrEqualConstraint, BigintLiteralType, BigintType, BooleanLiteralType, BooleanType, ConstraintBase, 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, SegmentPathConstraint, 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, segmentPath, segmentPathConstraintKind, 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 };
|
|
343
|
+
export { AbsolutePathConstraint, AllowedCharactersConstraint, ArrayLengthEqualConstraint, ArrayStructure, BetweenThanConstraint, BetweenThanOrEqualConstraint, BigintLiteralType, BigintType, BooleanLiteralType, BooleanType, ConstraintBase, DateType, EmailConstraint, ErrorSymbol, EvenConstraint, GreaterThanConstraint, GreaterThanOrEqualConstraint, IntegerConstraint, LazyStructure, LessThanConstraint, LessThanOrEqualConstraint, MaxCharactersConstraint, MaxElementsConstraint, MinCharactersConstraint, MinElementsConstraint, MultipleOfConstraint, NegativeConstraint, NonEncodableStringStructure, NotEmptyConstraint, NotZeroConstraint, NullType, NumberInStringConstraint, NumberLiteralType, NumberType, ObjectStructure, OddConstraint, PathConstraint, PositiveConstraint, RecordStructure, RefineConstraint, RegexConstraint, SafeConstraint, SegmentPathConstraint, 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, codecsJson, codecsKind, codecsString, 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, numberInString, numberInStringConstraintKind, numberLiteralTypeKind, numberTypeKind, object, objectStructureKind, odd, oddConstraintKind, optional, partial, path, pathConstraintKind, positive, positiveConstraintKind, record, recordStructureKind, refine, refineConstraintKind, regex, regexConstraintKind, required, safe, safeConstraintKind, segmentPath, segmentPathConstraintKind, 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 };
|
|
@@ -25,13 +25,13 @@ type CheckIsGreater<GreaterSplitValue extends DCommon.AnyTuple<DString.Digit>, G
|
|
|
25
25
|
infer InferredRestSplitValue extends DCommon.AnyTuple<DString.Digit>,
|
|
26
26
|
infer InferredRestSplitReference extends DCommon.AnyTuple<FigureGreaterThanTableValue>
|
|
27
27
|
] ? CheckIsGreater<InferredRestSplitValue, InferredRestSplitReference> : never : false;
|
|
28
|
-
type toStringDecimal<GenericValue extends number> = `${GenericValue}` extends `${DString.
|
|
28
|
+
type toStringDecimal<GenericValue extends number> = `${GenericValue}` extends `${DString.NumberInString}.${DString.NumberInString}` ? `${GenericValue}` : `${GenericValue}.0`;
|
|
29
29
|
type PrepareValues<GenericValue extends number, GenericReference extends number> = readonly [
|
|
30
30
|
toStringDecimal<GenericValue>,
|
|
31
31
|
toStringDecimal<GenericReference>
|
|
32
32
|
] extends readonly [
|
|
33
|
-
`${infer InferredValueInteger extends DString.
|
|
34
|
-
`${infer InferredReferenceInteger extends DString.
|
|
33
|
+
`${infer InferredValueInteger extends DString.NumberInString}.${infer InferredValueDecimals extends DString.NumberInString}`,
|
|
34
|
+
`${infer InferredReferenceInteger extends DString.NumberInString}.${infer InferredReferenceDecimals extends DString.NumberInString}`
|
|
35
35
|
] ? DCommon.And<[
|
|
36
36
|
DCommon.IsEqual<InferredValueDecimals, "0">,
|
|
37
37
|
DCommon.IsEqual<InferredReferenceDecimals, "0">
|
|
@@ -52,8 +52,8 @@ type PrepareValues<GenericValue extends number, GenericReference extends number>
|
|
|
52
52
|
`${infer InferredResultReference}`
|
|
53
53
|
] ? readonly [`${InferredResultValue}`, `${InferredResultReference}`] : never : never : readonly [InferredValueInteger, InferredReferenceInteger] : never;
|
|
54
54
|
type ComputeIsGreater<GenericValue extends number, GenericReference extends number> = PrepareValues<GenericValue, GenericReference> extends readonly [
|
|
55
|
-
infer InferredValue extends DString.
|
|
56
|
-
infer InferredReference extends DString.
|
|
55
|
+
infer InferredValue extends DString.NumberInString,
|
|
56
|
+
infer InferredReference extends DString.NumberInString
|
|
57
57
|
] ? DCommon.And<[
|
|
58
58
|
DString.Includes<InferredValue, "-">,
|
|
59
59
|
DCommon.Not<DString.Includes<InferredReference, "-">>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type * from './types';
|
|
2
1
|
export type * from './allowedCharacters';
|
|
3
2
|
export type * from './email';
|
|
4
3
|
export type * from './format';
|
|
@@ -6,6 +5,8 @@ export type * from './lengthEqual';
|
|
|
6
5
|
export type * from './maxCharacters';
|
|
7
6
|
export type * from './minCharacters';
|
|
8
7
|
export type * from './notEmpty';
|
|
8
|
+
export type * from './number';
|
|
9
9
|
export type * from './trimmed';
|
|
10
|
+
export type * from './types';
|
|
10
11
|
export type * from './url';
|
|
11
12
|
export type * from './uuid';
|
package/dist/string/index.cjs
CHANGED
|
@@ -14,6 +14,7 @@ const require_isEmail = require("./isEmail.cjs");
|
|
|
14
14
|
const require_isIn = require("./isIn.cjs");
|
|
15
15
|
const require_isKeyof = require("./isKeyof.cjs");
|
|
16
16
|
const require_isNotEmpty = require("./isNotEmpty.cjs");
|
|
17
|
+
const require_isNumber = require("./isNumber.cjs");
|
|
17
18
|
const require_isUrl = require("./isUrl.cjs");
|
|
18
19
|
const require_isUuid = require("./isUuid.cjs");
|
|
19
20
|
const require_join = require("./join.cjs");
|
|
@@ -67,6 +68,7 @@ var string_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
67
68
|
isIn: () => require_isIn.isIn,
|
|
68
69
|
isKeyof: () => require_isKeyof.isKeyof,
|
|
69
70
|
isNotEmpty: () => require_isNotEmpty.isNotEmpty,
|
|
71
|
+
isNumber: () => require_isNumber.isNumber,
|
|
70
72
|
isTrimmed: () => require_is.isTrimmed,
|
|
71
73
|
isUrl: () => require_isUrl.isUrl,
|
|
72
74
|
isUuid: () => require_isUuid.isUuid,
|
|
@@ -121,6 +123,7 @@ exports.isEmail = require_isEmail.isEmail;
|
|
|
121
123
|
exports.isIn = require_isIn.isIn;
|
|
122
124
|
exports.isKeyof = require_isKeyof.isKeyof;
|
|
123
125
|
exports.isNotEmpty = require_isNotEmpty.isNotEmpty;
|
|
126
|
+
exports.isNumber = require_isNumber.isNumber;
|
|
124
127
|
exports.isTrimmed = require_is.isTrimmed;
|
|
125
128
|
exports.isUrl = require_isUrl.isUrl;
|
|
126
129
|
exports.isUuid = require_isUuid.isUuid;
|
package/dist/string/index.d.ts
CHANGED
package/dist/string/index.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import { emailRegex, isEmail } from "./isEmail.mjs";
|
|
|
14
14
|
import { isIn } from "./isIn.mjs";
|
|
15
15
|
import { isKeyof } from "./isKeyof.mjs";
|
|
16
16
|
import { isNotEmpty } from "./isNotEmpty.mjs";
|
|
17
|
+
import { isNumber } from "./isNumber.mjs";
|
|
17
18
|
import { isUrl } from "./isUrl.mjs";
|
|
18
19
|
import { isUuid, uuidRegex } from "./isUuid.mjs";
|
|
19
20
|
import { join } from "./join.mjs";
|
|
@@ -67,6 +68,7 @@ var string_exports = /* @__PURE__ */ __exportAll({
|
|
|
67
68
|
isIn: () => isIn,
|
|
68
69
|
isKeyof: () => isKeyof,
|
|
69
70
|
isNotEmpty: () => isNotEmpty,
|
|
71
|
+
isNumber: () => isNumber,
|
|
70
72
|
isTrimmed: () => isTrimmed,
|
|
71
73
|
isUrl: () => isUrl,
|
|
72
74
|
isUuid: () => isUuid,
|
|
@@ -105,4 +107,4 @@ var string_exports = /* @__PURE__ */ __exportAll({
|
|
|
105
107
|
uuidRegex: () => uuidRegex
|
|
106
108
|
});
|
|
107
109
|
//#endregion
|
|
108
|
-
export { at, capitalize, charAt, concat, emailRegex, endsWith, extract, extractAll, first, includes, indexOf, isComposedOf, isEmail, isIn, isKeyof, isNotEmpty, isTrimmed, isUrl, isUuid, join, last, lastIndexOf, length, lengthEqual, maxCharacters, minCharacters, normalize, padEnd, padStart, pop, prepend, repeat, replace, replaceAll, search, shift, slice, sort, sortCompare, split, startsWith, string_exports, stringify, substring, test, to, toLowerCase, toUpperCase, trim, trimEnd, trimStart, uncapitalize, uuidRegex };
|
|
110
|
+
export { at, capitalize, charAt, concat, emailRegex, endsWith, extract, extractAll, first, includes, indexOf, isComposedOf, isEmail, isIn, isKeyof, isNotEmpty, isNumber, isTrimmed, isUrl, isUuid, join, last, lastIndexOf, length, lengthEqual, maxCharacters, minCharacters, normalize, padEnd, padStart, pop, prepend, repeat, replace, replaceAll, search, shift, slice, sort, sortCompare, split, startsWith, string_exports, stringify, substring, test, to, toLowerCase, toUpperCase, trim, trimEnd, trimStart, uncapitalize, uuidRegex };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Number } from './constraints';
|
|
2
|
+
import { NumberInString } from './types';
|
|
3
|
+
type ComputeResult<GenericValue extends string> = GenericValue extends Number ? GenericValue : GenericValue extends NumberInString ? GenericValue : GenericValue & Number;
|
|
4
|
+
export declare function isNumber<GenericValue extends string>(string: GenericValue): string is ComputeResult<GenericValue>;
|
|
5
|
+
export {};
|
package/dist/string/to.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Number } from './constraints';
|
|
2
|
+
import type * as DNumber from '../number';
|
|
3
|
+
type Stringifyable = (null | undefined | {
|
|
4
|
+
toString(): string;
|
|
5
|
+
});
|
|
6
|
+
type ComputeResult<GenericValue extends Stringifyable> = GenericValue extends number ? DNumber.IsLiteral<GenericValue> extends true ? `${GenericValue}` : string & Number : GenericValue extends (string | boolean | null | undefined | bigint) ? `${GenericValue}` : GenericValue extends {
|
|
7
|
+
toString(): string;
|
|
8
|
+
} ? ReturnType<GenericValue["toString"]> : never;
|
|
9
|
+
export declare function to<GenericValue extends Stringifyable>(value: GenericValue): ComputeResult<GenericValue>;
|
|
3
10
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type * from './at';
|
|
1
2
|
export type * from './countMinCharacters';
|
|
2
3
|
export type * from './digit';
|
|
3
4
|
export type * from './endsWith';
|
|
@@ -5,12 +6,14 @@ export type * from './first';
|
|
|
5
6
|
export type * from './forbiddenContain';
|
|
6
7
|
export type * from './forbiddenString';
|
|
7
8
|
export type * from './includes';
|
|
9
|
+
export type * from './isKeyPattern';
|
|
8
10
|
export type * from './isLiteral';
|
|
11
|
+
export type * from './isTemplateLiteral';
|
|
9
12
|
export type * from './join';
|
|
10
13
|
export type * from './last';
|
|
11
14
|
export type * from './length';
|
|
12
15
|
export type * from './normalizeForm';
|
|
13
|
-
export type * from './
|
|
16
|
+
export type * from './numberInString';
|
|
14
17
|
export type * from './pop';
|
|
15
18
|
export type * from './replace';
|
|
16
19
|
export type * from './requireLiteral';
|
|
@@ -18,7 +21,3 @@ export type * from './requireSimpleLiteral';
|
|
|
18
21
|
export type * from './shift';
|
|
19
22
|
export type * from './split';
|
|
20
23
|
export type * from './startsWith';
|
|
21
|
-
export type * from './isKeyPattern';
|
|
22
|
-
export type * from './at';
|
|
23
|
-
export type * from './first';
|
|
24
|
-
export type * from './last';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type NumberInString = `${number}`;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Number = `${number}`;
|