@esposter/shared 2.21.0 → 2.22.0
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/index.d.ts +64 -41
- package/dist/index.js +45 -13
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -127,10 +127,10 @@ declare abstract class Serializable {
|
|
|
127
127
|
//#region src/models/shared/TakeOne.d.ts
|
|
128
128
|
interface TakeOne {
|
|
129
129
|
<T extends readonly unknown[]>(values: T, index?: number): T[number];
|
|
130
|
-
<T extends Record<PropertyKey, unknown>>(values: T, index: keyof T): T[keyof T];
|
|
130
|
+
<T extends object | Record<PropertyKey, unknown>>(values: T, index: keyof T): T[keyof T];
|
|
131
131
|
}
|
|
132
132
|
//#endregion
|
|
133
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
133
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/primitive.d.ts
|
|
134
134
|
/**
|
|
135
135
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
136
136
|
|
|
@@ -138,7 +138,7 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
|
|
|
138
138
|
*/
|
|
139
139
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
140
140
|
//#endregion
|
|
141
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
141
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/basic.d.ts
|
|
142
142
|
/**
|
|
143
143
|
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
|
144
144
|
|
|
@@ -149,7 +149,7 @@ type Class<T, Arguments extends unknown[] = any[]> = {
|
|
|
149
149
|
new (...arguments_: Arguments): T;
|
|
150
150
|
};
|
|
151
151
|
//#endregion
|
|
152
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
152
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-any.d.ts
|
|
153
153
|
/**
|
|
154
154
|
Returns a boolean for whether the given type is `any`.
|
|
155
155
|
|
|
@@ -180,7 +180,7 @@ const anyA = get(anyObject, 'a');
|
|
|
180
180
|
*/
|
|
181
181
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
182
182
|
//#endregion
|
|
183
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
183
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
184
184
|
/**
|
|
185
185
|
Returns a boolean for whether the given key is an optional key of type.
|
|
186
186
|
|
|
@@ -223,7 +223,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
223
223
|
*/
|
|
224
224
|
type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
|
|
225
225
|
//#endregion
|
|
226
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
226
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
227
227
|
/**
|
|
228
228
|
Extract all optional keys from the given type.
|
|
229
229
|
|
|
@@ -261,7 +261,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
261
261
|
? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
262
262
|
: never;
|
|
263
263
|
//#endregion
|
|
264
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
264
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
265
265
|
/**
|
|
266
266
|
Extract all required keys from the given type.
|
|
267
267
|
|
|
@@ -295,7 +295,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
295
295
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
296
296
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
297
297
|
//#endregion
|
|
298
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
298
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-never.d.ts
|
|
299
299
|
/**
|
|
300
300
|
Returns a boolean for whether the given type is `never`.
|
|
301
301
|
|
|
@@ -351,7 +351,7 @@ type B = IsTrueFixed<never>;
|
|
|
351
351
|
*/
|
|
352
352
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
353
353
|
//#endregion
|
|
354
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
354
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/if.d.ts
|
|
355
355
|
/**
|
|
356
356
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
357
357
|
|
|
@@ -446,7 +446,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
446
446
|
*/
|
|
447
447
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
448
448
|
//#endregion
|
|
449
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
449
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/unknown-array.d.ts
|
|
450
450
|
/**
|
|
451
451
|
Represents an array with `unknown` value.
|
|
452
452
|
|
|
@@ -473,7 +473,7 @@ type C = IsArray<string>;
|
|
|
473
473
|
*/
|
|
474
474
|
type UnknownArray = readonly unknown[];
|
|
475
475
|
//#endregion
|
|
476
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
476
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/type.d.ts
|
|
477
477
|
/**
|
|
478
478
|
Returns a boolean for whether A is false.
|
|
479
479
|
|
|
@@ -537,7 +537,7 @@ Indicates the value of `exactOptionalPropertyTypes` compiler option.
|
|
|
537
537
|
*/
|
|
538
538
|
type IsExactOptionalPropertyTypesEnabled = [(string | undefined)?] extends [string?] ? false : true;
|
|
539
539
|
//#endregion
|
|
540
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
540
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/array.d.ts
|
|
541
541
|
/**
|
|
542
542
|
Transforms a tuple type by replacing it's rest element with a single element that has the same type as the rest element, while keeping all the non-rest elements intact.
|
|
543
543
|
|
|
@@ -579,7 +579,7 @@ type _CollapseRestElement<TArray extends UnknownArray, ForwardAccumulator extend
|
|
|
579
579
|
: First], BackwardAccumulator> : never // Should never happen, since `[(infer First)?, ...infer Rest]` is a top-type for arrays.
|
|
580
580
|
: never; // Should never happen
|
|
581
581
|
//#endregion
|
|
582
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
582
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/characters.d.ts
|
|
583
583
|
type Whitespace = '\u{9}' // '\t'
|
|
584
584
|
| '\u{A}' // '\n'
|
|
585
585
|
| '\u{B}' // '\v'
|
|
@@ -593,19 +593,17 @@ type AsciiPunctuation = '!' | '"' | '#' | '$' | '%' | '&' | '\'' | '(' | ')' | '
|
|
|
593
593
|
//#region ../../node_modules/.pnpm/tagged-tag@1.0.0/node_modules/tagged-tag/index.d.ts
|
|
594
594
|
declare const tag: unique symbol;
|
|
595
595
|
//#endregion
|
|
596
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
596
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/tagged.d.ts
|
|
597
597
|
// eslint-disable-next-line type-fest/require-exported-types
|
|
598
598
|
type TagContainer<Token> = {
|
|
599
599
|
readonly [tag]: Token;
|
|
600
600
|
};
|
|
601
601
|
type Tag<Token extends PropertyKey, TagMetadata> = TagContainer<{ [K in Token]: TagMetadata }>;
|
|
602
602
|
/**
|
|
603
|
-
|
|
603
|
+
Create a [tagged type](https://medium.com/@KevinBGreene/surviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d) that can support [multiple tags](https://github.com/sindresorhus/type-fest/issues/665) and [per-tag metadata](https://medium.com/@ethanresnick/advanced-typescript-tagged-types-improved-with-type-level-metadata-5072fc125fcf).
|
|
604
604
|
|
|
605
605
|
A type returned by `Tagged` can be passed to `Tagged` again, to create a type with multiple tags.
|
|
606
606
|
|
|
607
|
-
[Read more about tagged types.](https://medium.com/@KevinBGreene/surviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d)
|
|
608
|
-
|
|
609
607
|
A tag's name is usually a string (and must be a string, number, or symbol), but each application of a tag can also contain an arbitrary type as its "metadata". See {@link GetTagMetadata} for examples and explanation.
|
|
610
608
|
|
|
611
609
|
A type `A` returned by `Tagged` is assignable to another type `B` returned by `Tagged` if and only if:
|
|
@@ -662,7 +660,7 @@ type SpecialCacheKey2 = Tagged<string, 'URL' | 'SpecialCacheKey'>;
|
|
|
662
660
|
*/
|
|
663
661
|
type Tagged<Type, TagName extends PropertyKey, TagMetadata = never> = Type & Tag<TagName, TagMetadata>;
|
|
664
662
|
/**
|
|
665
|
-
|
|
663
|
+
Get the untagged portion of a tagged type created with `Tagged`.
|
|
666
664
|
|
|
667
665
|
Why is this necessary?
|
|
668
666
|
|
|
@@ -767,7 +765,7 @@ type Person = {
|
|
|
767
765
|
@deprecated Use {@link Tagged} instead
|
|
768
766
|
*/
|
|
769
767
|
//#endregion
|
|
770
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
768
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-literal.d.ts
|
|
771
769
|
/**
|
|
772
770
|
Returns a boolean for whether the given type is a `string` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
773
771
|
|
|
@@ -829,7 +827,7 @@ type _IsStringLiteral<S> = // If `T` is an infinite string type (e.g., `on${stri
|
|
|
829
827
|
// and since `{}` extends index signatures, the result becomes `false`.
|
|
830
828
|
S extends string ? {} extends Record<S, never> ? false : true : false;
|
|
831
829
|
//#endregion
|
|
832
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
830
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/trim.d.ts
|
|
833
831
|
/**
|
|
834
832
|
Remove spaces from the left side.
|
|
835
833
|
*/
|
|
@@ -854,7 +852,7 @@ type Example = Trim<' foo '>;
|
|
|
854
852
|
*/
|
|
855
853
|
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
856
854
|
//#endregion
|
|
857
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
855
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/string.d.ts
|
|
858
856
|
/**
|
|
859
857
|
Returns a boolean for whether the given string `S` starts with the given string `SearchString`.
|
|
860
858
|
|
|
@@ -884,7 +882,7 @@ This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/mi
|
|
|
884
882
|
*/
|
|
885
883
|
type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
886
884
|
//#endregion
|
|
887
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
885
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/simplify.d.ts
|
|
888
886
|
/**
|
|
889
887
|
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
890
888
|
|
|
@@ -945,7 +943,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
945
943
|
*/
|
|
946
944
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
947
945
|
//#endregion
|
|
948
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
946
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-equal.d.ts
|
|
949
947
|
/**
|
|
950
948
|
Returns a boolean for whether the two given types are equal.
|
|
951
949
|
|
|
@@ -976,7 +974,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
976
974
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
977
975
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
978
976
|
//#endregion
|
|
979
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
977
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
980
978
|
/**
|
|
981
979
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
982
980
|
|
|
@@ -1070,7 +1068,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
1070
1068
|
*/
|
|
1071
1069
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
1072
1070
|
//#endregion
|
|
1073
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1071
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
1074
1072
|
/**
|
|
1075
1073
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
1076
1074
|
|
|
@@ -1118,7 +1116,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
1118
1116
|
*/
|
|
1119
1117
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
1120
1118
|
//#endregion
|
|
1121
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1119
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/merge.d.ts
|
|
1122
1120
|
// Merges two objects without worrying about index signatures.
|
|
1123
1121
|
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
1124
1122
|
/**
|
|
@@ -1190,7 +1188,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
|
|
|
1190
1188
|
// Should never happen
|
|
1191
1189
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
1192
1190
|
//#endregion
|
|
1193
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1191
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/object.d.ts
|
|
1194
1192
|
/**
|
|
1195
1193
|
Merges user specified options with default options.
|
|
1196
1194
|
|
|
@@ -1274,7 +1272,7 @@ type E = CollapseLiterals<LiteralUnion<'foo' | 'bar', string> | null | undefined
|
|
|
1274
1272
|
*/
|
|
1275
1273
|
type CollapseLiterals<T> = {} extends T ? T : T extends infer U & {} ? U : T;
|
|
1276
1274
|
//#endregion
|
|
1277
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1275
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/some-extend.d.ts
|
|
1278
1276
|
/**
|
|
1279
1277
|
@see {@link SomeExtend}
|
|
1280
1278
|
*/
|
|
@@ -1356,7 +1354,7 @@ type SomeExtend<TArray extends UnknownArray, Type, Options extends SomeExtendOpt
|
|
|
1356
1354
|
type _SomeExtend<TArray extends UnknownArray, Type, Options extends Required<SomeExtendOptions>> = IfNotAnyOrNever<TArray, TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type>, IsAny<Type>>, Not<Options['strictNever']>> extends true // If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, return `true`.
|
|
1357
1355
|
? true : _SomeExtend<Rest, Type, Options> : First extends Type ? true : _SomeExtend<Rest, Type, Options> : false, false, false>;
|
|
1358
1356
|
//#endregion
|
|
1359
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1357
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/or-all.d.ts
|
|
1360
1358
|
/**
|
|
1361
1359
|
Returns a boolean for whether any of the given elements is `true`.
|
|
1362
1360
|
|
|
@@ -1427,9 +1425,9 @@ Note: `OrAll<[]>` evaluates to `false` because there are no `true` elements in a
|
|
|
1427
1425
|
*/
|
|
1428
1426
|
type OrAll<T extends readonly boolean[]> = SomeExtend<T, true>;
|
|
1429
1427
|
//#endregion
|
|
1430
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1428
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/or.d.ts
|
|
1431
1429
|
/**
|
|
1432
|
-
Returns a boolean for whether either of two given types is true
|
|
1430
|
+
Returns a boolean for whether either of two given types is `true`.
|
|
1433
1431
|
|
|
1434
1432
|
Use-case: Constructing complex conditional types where at least one condition must be satisfied.
|
|
1435
1433
|
|
|
@@ -1507,7 +1505,7 @@ type G = Or<never, never>;
|
|
|
1507
1505
|
*/
|
|
1508
1506
|
type Or<A extends boolean, B extends boolean> = OrAll<[A, B]>;
|
|
1509
1507
|
//#endregion
|
|
1510
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1508
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/all-extend.d.ts
|
|
1511
1509
|
/**
|
|
1512
1510
|
@see {@link AllExtend}
|
|
1513
1511
|
*/
|
|
@@ -1593,7 +1591,7 @@ type AllExtend<TArray extends UnknownArray, Type, Options extends AllExtendOptio
|
|
|
1593
1591
|
type _AllExtend<TArray extends UnknownArray, Type, Options extends Required<AllExtendOptions>> = IfNotAnyOrNever<TArray, TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type>, IsAny<Type>>, Not<Options['strictNever']>> extends true // If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, recurse further.
|
|
1594
1592
|
? _AllExtend<Rest, Type, Options> : false : First extends Type ? _AllExtend<Rest, Type, Options> : false : true, false, false>;
|
|
1595
1593
|
//#endregion
|
|
1596
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1594
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/except.d.ts
|
|
1597
1595
|
/**
|
|
1598
1596
|
Filter out keys from an object.
|
|
1599
1597
|
|
|
@@ -1691,7 +1689,7 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
1691
1689
|
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
1692
1690
|
type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
|
|
1693
1691
|
//#endregion
|
|
1694
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1692
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-lowercase.d.ts
|
|
1695
1693
|
/**
|
|
1696
1694
|
Returns a boolean for whether the given string literal is lowercase.
|
|
1697
1695
|
|
|
@@ -1719,7 +1717,7 @@ Returns a boolean for whether an individual part of the string is lowercase.
|
|
|
1719
1717
|
*/
|
|
1720
1718
|
type IsLowercaseHelper<S extends string> = S extends Lowercase<string> ? true : S extends Uppercase<string> | Capitalize<string> | `${string}${Uppercase<string>}${string}` ? false : boolean;
|
|
1721
1719
|
//#endregion
|
|
1722
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1720
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-uppercase.d.ts
|
|
1723
1721
|
/**
|
|
1724
1722
|
Returns a boolean for whether the given string literal is uppercase.
|
|
1725
1723
|
|
|
@@ -1747,7 +1745,7 @@ Returns a boolean for whether an individual part of the string is uppercase.
|
|
|
1747
1745
|
*/
|
|
1748
1746
|
type IsUppercaseHelper<S extends string> = S extends Uppercase<string> ? true : S extends Lowercase<string> | Uncapitalize<string> | `${string}${Lowercase<string>}${string}` ? false : boolean;
|
|
1749
1747
|
//#endregion
|
|
1750
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1748
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/words.d.ts
|
|
1751
1749
|
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
1752
1750
|
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
1753
1751
|
/**
|
|
@@ -1769,15 +1767,29 @@ type WordsOptions = {
|
|
|
1769
1767
|
```
|
|
1770
1768
|
*/
|
|
1771
1769
|
splitOnNumbers?: boolean;
|
|
1770
|
+
/**
|
|
1771
|
+
Split on {@link AsciiPunctuation | punctuation characters} (e.g., `#`, `&`, `*`, `:`, `?`, `@`, `~`).
|
|
1772
|
+
@example
|
|
1773
|
+
```
|
|
1774
|
+
import type {Words} from 'type-fest';
|
|
1775
|
+
type Example1 = Words<'hello:world', {splitOnPunctuation: true}>;
|
|
1776
|
+
//=> ['hello', 'world']
|
|
1777
|
+
type Example2 = Words<'hello:world', {splitOnPunctuation: false}>;
|
|
1778
|
+
//=> ['hello', ':world']
|
|
1779
|
+
```
|
|
1780
|
+
*/
|
|
1781
|
+
splitOnPunctuation?: boolean;
|
|
1772
1782
|
};
|
|
1773
1783
|
type _DefaultWordsOptions = {
|
|
1774
1784
|
splitOnNumbers: true;
|
|
1785
|
+
splitOnPunctuation: false;
|
|
1775
1786
|
};
|
|
1776
1787
|
/**
|
|
1777
|
-
Split a string
|
|
1788
|
+
Split a string similar to Lodash's `_.words()` function.
|
|
1778
1789
|
|
|
1779
1790
|
- Split on each word that begins with a capital letter.
|
|
1780
1791
|
- Split on each {@link WordSeparators}.
|
|
1792
|
+
- Split on each {@link AsciiPunctuation} (if {@link WordsOptions.splitOnPunctuation} is enabled).
|
|
1781
1793
|
- Split on numeric sequence.
|
|
1782
1794
|
|
|
1783
1795
|
@example
|
|
@@ -1801,13 +1813,22 @@ type Words4 = Words<'lifeIs42'>;
|
|
|
1801
1813
|
|
|
1802
1814
|
type Words5 = Words<'p2pNetwork', {splitOnNumbers: false}>;
|
|
1803
1815
|
//=> ['p2p', 'Network']
|
|
1816
|
+
|
|
1817
|
+
type Words6 = Words<'hello:world', {splitOnPunctuation: true}>;
|
|
1818
|
+
//=> ['hello', 'world']
|
|
1819
|
+
|
|
1820
|
+
type Words7 = Words<'hello:world', {splitOnPunctuation: false}>;
|
|
1821
|
+
//=> ['hello', ':world']
|
|
1822
|
+
|
|
1823
|
+
type Words8 = Words<'hello::world', {splitOnPunctuation: true}>;
|
|
1824
|
+
//=> ['hello', 'world']
|
|
1804
1825
|
```
|
|
1805
1826
|
|
|
1806
1827
|
@category Change case
|
|
1807
1828
|
@category Template literal
|
|
1808
1829
|
*/
|
|
1809
1830
|
type Words<Sentence extends string, Options extends WordsOptions = {}> = WordsImplementation<Sentence, ApplyDefaultOptions<WordsOptions, _DefaultWordsOptions, Options>>;
|
|
1810
|
-
type WordsImplementation<Sentence extends string, Options extends Required<WordsOptions>, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators // Skip word separator
|
|
1831
|
+
type WordsImplementation<Sentence extends string, Options extends Required<WordsOptions>, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators | (Options['splitOnPunctuation'] extends true ? AsciiPunctuation : never) // Skip word separator
|
|
1811
1832
|
? [...SkipEmptyWord<CurrentWord>, ...WordsImplementation<RemainingCharacters, Options>] : LastCharacter extends '' // Fist char of word
|
|
1812
1833
|
? WordsImplementation<RemainingCharacters, Options, FirstCharacter, FirstCharacter> // Case change: non-numeric to numeric
|
|
1813
1834
|
: [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? Options['splitOnNumbers'] extends true // Split on number: push word
|
|
@@ -1821,7 +1842,7 @@ type WordsImplementation<Sentence extends string, Options extends Required<Words
|
|
|
1821
1842
|
: [true, true] extends [IsUppercase<LastCharacter>, IsLowercase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...WordsImplementation<RemainingCharacters, Options, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] // No case change: concat word
|
|
1822
1843
|
: WordsImplementation<RemainingCharacters, Options, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
|
|
1823
1844
|
//#endregion
|
|
1824
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1845
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/remove-prefix.d.ts
|
|
1825
1846
|
/**
|
|
1826
1847
|
@see {@link RemovePrefix}
|
|
1827
1848
|
*/
|
|
@@ -1911,7 +1932,7 @@ type _RemovePrefix<S extends string, Prefix extends string, Options extends Requ
|
|
|
1911
1932
|
: S // Return back `S` when `Prefix` is not present at the start of `S`
|
|
1912
1933
|
: never;
|
|
1913
1934
|
//#endregion
|
|
1914
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1935
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/delimiter-case.d.ts
|
|
1915
1936
|
type _DefaultDelimiterCaseOptions = Merge<_DefaultWordsOptions, {
|
|
1916
1937
|
splitOnNumbers: false;
|
|
1917
1938
|
}>;
|
|
@@ -1935,6 +1956,7 @@ import type {DelimiterCase} from 'type-fest';
|
|
|
1935
1956
|
|
|
1936
1957
|
const someVariable: DelimiterCase<'fooBar', '#'> = 'foo#bar';
|
|
1937
1958
|
const someVariableNoSplitOnNumbers: DelimiterCase<'p2pNetwork', '#', {splitOnNumbers: false}> = 'p2p#network';
|
|
1959
|
+
const someVariableWithPunctuation: DelimiterCase<'div.card::after', '#', {splitOnPunctuation: true}> = 'div#card#after';
|
|
1938
1960
|
|
|
1939
1961
|
// Advanced
|
|
1940
1962
|
|
|
@@ -1962,7 +1984,7 @@ type DelimiterCase<Value, Delimiter extends string, Options extends WordsOptions
|
|
|
1962
1984
|
strict: false;
|
|
1963
1985
|
}>> : Value;
|
|
1964
1986
|
//#endregion
|
|
1965
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1987
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/kebab-case.d.ts
|
|
1966
1988
|
/**
|
|
1967
1989
|
Convert a string literal to kebab-case.
|
|
1968
1990
|
|
|
@@ -1976,6 +1998,7 @@ import type {KebabCase} from 'type-fest';
|
|
|
1976
1998
|
|
|
1977
1999
|
const someVariable: KebabCase<'fooBar'> = 'foo-bar';
|
|
1978
2000
|
const someVariableNoSplitOnNumbers: KebabCase<'p2pNetwork', {splitOnNumbers: false}> = 'p2p-network';
|
|
2001
|
+
const someVariableWithPunctuation: KebabCase<'div.card::after', {splitOnPunctuation: true}> = 'div-card-after';
|
|
1979
2002
|
|
|
1980
2003
|
// Advanced
|
|
1981
2004
|
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
8
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
9
|
var __exportAll = (all, no_symbols) => {
|
|
10
10
|
let target = {};
|
|
11
11
|
for (var name in all) __defProp(target, name, {
|
|
@@ -180,9 +180,9 @@ let Operation = /* @__PURE__ */ function(Operation) {
|
|
|
180
180
|
return Operation;
|
|
181
181
|
}({});
|
|
182
182
|
//#endregion
|
|
183
|
-
//#region ../../node_modules/.pnpm/@vue+shared@3.5.
|
|
183
|
+
//#region ../../node_modules/.pnpm/@vue+shared@3.5.33/node_modules/@vue/shared/dist/shared.esm-bundler.js
|
|
184
184
|
/**
|
|
185
|
-
* @vue/shared v3.5.
|
|
185
|
+
* @vue/shared v3.5.33
|
|
186
186
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
187
187
|
* @license MIT
|
|
188
188
|
**/
|
|
@@ -252,9 +252,9 @@ const getGlobalThis = () => {
|
|
|
252
252
|
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
253
253
|
};
|
|
254
254
|
//#endregion
|
|
255
|
-
//#region ../../node_modules/.pnpm/@vue+reactivity@3.5.
|
|
255
|
+
//#region ../../node_modules/.pnpm/@vue+reactivity@3.5.33/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
|
|
256
256
|
/**
|
|
257
|
-
* @vue/reactivity v3.5.
|
|
257
|
+
* @vue/reactivity v3.5.33
|
|
258
258
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
259
259
|
* @license MIT
|
|
260
260
|
**/
|
|
@@ -1354,9 +1354,9 @@ function traverse(value, depth = Infinity, seen) {
|
|
|
1354
1354
|
return value;
|
|
1355
1355
|
}
|
|
1356
1356
|
//#endregion
|
|
1357
|
-
//#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.
|
|
1357
|
+
//#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.33/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
|
|
1358
1358
|
/**
|
|
1359
|
-
* @vue/runtime-core v3.5.
|
|
1359
|
+
* @vue/runtime-core v3.5.33
|
|
1360
1360
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
1361
1361
|
* @license MIT
|
|
1362
1362
|
**/
|
|
@@ -2313,9 +2313,9 @@ function initCustomFormatter() {
|
|
|
2313
2313
|
else window.devtoolsFormatters = [formatter];
|
|
2314
2314
|
}
|
|
2315
2315
|
//#endregion
|
|
2316
|
-
//#region ../../node_modules/.pnpm/vue@3.5.
|
|
2316
|
+
//#region ../../node_modules/.pnpm/vue@3.5.33_typescript@5.9.3/node_modules/vue/dist/vue.runtime.esm-bundler.js
|
|
2317
2317
|
/**
|
|
2318
|
-
* vue v3.5.
|
|
2318
|
+
* vue v3.5.33
|
|
2319
2319
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
2320
2320
|
* @license MIT
|
|
2321
2321
|
**/
|
|
@@ -6651,6 +6651,10 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6651
6651
|
this.endIndex = null;
|
|
6652
6652
|
}
|
|
6653
6653
|
Object.defineProperty(Node.prototype, "parentNode", {
|
|
6654
|
+
/**
|
|
6655
|
+
* Same as {@link parent}.
|
|
6656
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
6657
|
+
*/
|
|
6654
6658
|
get: function() {
|
|
6655
6659
|
return this.parent;
|
|
6656
6660
|
},
|
|
@@ -6661,6 +6665,10 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6661
6665
|
configurable: true
|
|
6662
6666
|
});
|
|
6663
6667
|
Object.defineProperty(Node.prototype, "previousSibling", {
|
|
6668
|
+
/**
|
|
6669
|
+
* Same as {@link prev}.
|
|
6670
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
6671
|
+
*/
|
|
6664
6672
|
get: function() {
|
|
6665
6673
|
return this.prev;
|
|
6666
6674
|
},
|
|
@@ -6671,6 +6679,10 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6671
6679
|
configurable: true
|
|
6672
6680
|
});
|
|
6673
6681
|
Object.defineProperty(Node.prototype, "nextSibling", {
|
|
6682
|
+
/**
|
|
6683
|
+
* Same as {@link next}.
|
|
6684
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
6685
|
+
*/
|
|
6674
6686
|
get: function() {
|
|
6675
6687
|
return this.next;
|
|
6676
6688
|
},
|
|
@@ -6707,6 +6719,10 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6707
6719
|
return _this;
|
|
6708
6720
|
}
|
|
6709
6721
|
Object.defineProperty(DataNode.prototype, "nodeValue", {
|
|
6722
|
+
/**
|
|
6723
|
+
* Same as {@link data}.
|
|
6724
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
6725
|
+
*/
|
|
6710
6726
|
get: function() {
|
|
6711
6727
|
return this.data;
|
|
6712
6728
|
},
|
|
@@ -6794,6 +6810,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6794
6810
|
return _this;
|
|
6795
6811
|
}
|
|
6796
6812
|
Object.defineProperty(NodeWithChildren.prototype, "firstChild", {
|
|
6813
|
+
/** First child of the node. */
|
|
6797
6814
|
get: function() {
|
|
6798
6815
|
var _a;
|
|
6799
6816
|
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
|
@@ -6802,6 +6819,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6802
6819
|
configurable: true
|
|
6803
6820
|
});
|
|
6804
6821
|
Object.defineProperty(NodeWithChildren.prototype, "lastChild", {
|
|
6822
|
+
/** Last child of the node. */
|
|
6805
6823
|
get: function() {
|
|
6806
6824
|
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
|
|
6807
6825
|
},
|
|
@@ -6809,6 +6827,10 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6809
6827
|
configurable: true
|
|
6810
6828
|
});
|
|
6811
6829
|
Object.defineProperty(NodeWithChildren.prototype, "childNodes", {
|
|
6830
|
+
/**
|
|
6831
|
+
* Same as {@link children}.
|
|
6832
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
6833
|
+
*/
|
|
6812
6834
|
get: function() {
|
|
6813
6835
|
return this.children;
|
|
6814
6836
|
},
|
|
@@ -6885,6 +6907,10 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6885
6907
|
configurable: true
|
|
6886
6908
|
});
|
|
6887
6909
|
Object.defineProperty(Element.prototype, "tagName", {
|
|
6910
|
+
/**
|
|
6911
|
+
* Same as {@link name}.
|
|
6912
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
6913
|
+
*/
|
|
6888
6914
|
get: function() {
|
|
6889
6915
|
return this.name;
|
|
6890
6916
|
},
|
|
@@ -12406,6 +12432,9 @@ var require_subselects = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12406
12432
|
};
|
|
12407
12433
|
exports.subselects = {
|
|
12408
12434
|
is,
|
|
12435
|
+
/**
|
|
12436
|
+
* `:matches` and `:where` are aliases for `:is`.
|
|
12437
|
+
*/
|
|
12409
12438
|
matches: is,
|
|
12410
12439
|
where: is,
|
|
12411
12440
|
not: function(next, token, options, context, compileToken) {
|
|
@@ -13300,7 +13329,8 @@ var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13300
13329
|
* @param {HTMLElement} newNode new node
|
|
13301
13330
|
*/
|
|
13302
13331
|
exchangeChild(oldNode, newNode) {
|
|
13303
|
-
|
|
13332
|
+
const children = this.childNodes;
|
|
13333
|
+
this.childNodes = children.map((child) => {
|
|
13304
13334
|
if (child === oldNode) return newNode;
|
|
13305
13335
|
return child;
|
|
13306
13336
|
});
|
|
@@ -13338,7 +13368,8 @@ var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13338
13368
|
return decode(this.rawText);
|
|
13339
13369
|
}
|
|
13340
13370
|
set textContent(val) {
|
|
13341
|
-
|
|
13371
|
+
const content = [new text_1.default(val, this)];
|
|
13372
|
+
this.childNodes = content;
|
|
13342
13373
|
}
|
|
13343
13374
|
/**
|
|
13344
13375
|
* Get unescaped text value of current node and its children.
|
|
@@ -13490,10 +13521,11 @@ var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13490
13521
|
this.childNodes[o++] = node;
|
|
13491
13522
|
});
|
|
13492
13523
|
this.childNodes.length = o;
|
|
13493
|
-
|
|
13524
|
+
const attrs = Object.keys(this.rawAttributes).map((key) => {
|
|
13494
13525
|
const val = this.rawAttributes[key];
|
|
13495
13526
|
return `${key}=${JSON.stringify(val)}`;
|
|
13496
13527
|
}).join(" ");
|
|
13528
|
+
this.rawAttrs = attrs;
|
|
13497
13529
|
delete this._rawAttrs;
|
|
13498
13530
|
return this;
|
|
13499
13531
|
}
|
|
@@ -14421,7 +14453,7 @@ const now = () => {
|
|
|
14421
14453
|
//#endregion
|
|
14422
14454
|
//#region src/util/validation/exhaustiveGuard.ts
|
|
14423
14455
|
const exhaustiveGuard = (value) => {
|
|
14424
|
-
throw new InvalidOperationError(
|
|
14456
|
+
throw new InvalidOperationError("Read", exhaustiveGuard.name, JSON.stringify(value));
|
|
14425
14457
|
};
|
|
14426
14458
|
//#endregion
|
|
14427
14459
|
//#region src/util/id/uuid/constants.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esposter/shared",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.0",
|
|
4
4
|
"description": "A library that contains shared typescript code.",
|
|
5
5
|
"homepage": "https://github.com/Esposter/Esposter/blob/main/packages/shared#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@vueuse/core": "^14.2.1",
|
|
37
37
|
"node-html-parser": "^7.1.0",
|
|
38
|
-
"vue": "^3.5.
|
|
38
|
+
"vue": "^3.5.33",
|
|
39
39
|
"zod": "^4.3.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@azure/data-tables": "^13.3.2"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "405a6743bb0fdae18c07faff17037b9e7a345939"
|
|
45
45
|
}
|