@esposter/shared 2.24.0 → 2.26.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/README.md +2 -2
- package/dist/index.d.ts +58 -130
- package/dist/index.js +33 -2092
- package/package.json +15 -7
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
Shared TypeScript utilities, types, and error classes for the Esposter platform. Works in both browser and server environments.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Table of Contents
|
|
11
11
|
|
|
12
12
|
- 🚀 [Getting Started](#getting-started)
|
|
13
13
|
- 📖 [Documentation](#documentation)
|
|
@@ -18,7 +18,7 @@ Shared TypeScript utilities, types, and error classes for the Esposter platform.
|
|
|
18
18
|
## <a name="getting-started">🚀 Getting Started</a>
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
pnpm i @esposter/shared
|
|
21
|
+
pnpm i @esposter/shared @vueuse/core vue zod
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## <a name="documentation">📖 Documentation</a>
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,19 @@ declare class NotInitializedError<T extends string = string> extends Error {
|
|
|
36
36
|
constructor(name: T);
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
39
|
+
//#region src/models/message/ClassifiedMentions.d.ts
|
|
40
|
+
interface ClassifiedMentions {
|
|
41
|
+
broadcastIds: string[];
|
|
42
|
+
regularUserIds: string[];
|
|
43
|
+
roleIds: string[];
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/models/message/MentionType.d.ts
|
|
47
|
+
declare enum MentionType {
|
|
48
|
+
Role = "role",
|
|
49
|
+
User = "user"
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
39
52
|
//#region src/models/router/RoutePath.d.ts
|
|
40
53
|
declare const RoutePath: {
|
|
41
54
|
readonly About: "/about";
|
|
@@ -140,7 +153,7 @@ interface TakeOne {
|
|
|
140
153
|
<T extends object | Record<PropertyKey, unknown>>(values: T, index: keyof T): T[keyof T];
|
|
141
154
|
}
|
|
142
155
|
//#endregion
|
|
143
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
156
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/primitive.d.ts
|
|
144
157
|
/**
|
|
145
158
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
146
159
|
|
|
@@ -148,7 +161,7 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
|
|
|
148
161
|
*/
|
|
149
162
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
150
163
|
//#endregion
|
|
151
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
164
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/basic.d.ts
|
|
152
165
|
/**
|
|
153
166
|
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
|
154
167
|
|
|
@@ -159,7 +172,7 @@ type Class<T, Arguments extends unknown[] = any[]> = {
|
|
|
159
172
|
new (...arguments_: Arguments): T;
|
|
160
173
|
};
|
|
161
174
|
//#endregion
|
|
162
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
175
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-any.d.ts
|
|
163
176
|
/**
|
|
164
177
|
Returns a boolean for whether the given type is `any`.
|
|
165
178
|
|
|
@@ -190,7 +203,7 @@ const anyA = get(anyObject, 'a');
|
|
|
190
203
|
*/
|
|
191
204
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
192
205
|
//#endregion
|
|
193
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
206
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
194
207
|
/**
|
|
195
208
|
Returns a boolean for whether the given key is an optional key of type.
|
|
196
209
|
|
|
@@ -233,7 +246,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
233
246
|
*/
|
|
234
247
|
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;
|
|
235
248
|
//#endregion
|
|
236
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
249
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
237
250
|
/**
|
|
238
251
|
Extract all optional keys from the given type.
|
|
239
252
|
|
|
@@ -271,7 +284,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
271
284
|
? (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`
|
|
272
285
|
: never;
|
|
273
286
|
//#endregion
|
|
274
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
287
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
275
288
|
/**
|
|
276
289
|
Extract all required keys from the given type.
|
|
277
290
|
|
|
@@ -305,7 +318,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
305
318
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
306
319
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
307
320
|
//#endregion
|
|
308
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
321
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-never.d.ts
|
|
309
322
|
/**
|
|
310
323
|
Returns a boolean for whether the given type is `never`.
|
|
311
324
|
|
|
@@ -361,7 +374,7 @@ type B = IsTrueFixed<never>;
|
|
|
361
374
|
*/
|
|
362
375
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
363
376
|
//#endregion
|
|
364
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
377
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/if.d.ts
|
|
365
378
|
/**
|
|
366
379
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
367
380
|
|
|
@@ -456,7 +469,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
456
469
|
*/
|
|
457
470
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
458
471
|
//#endregion
|
|
459
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
472
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/unknown-array.d.ts
|
|
460
473
|
/**
|
|
461
474
|
Represents an array with `unknown` value.
|
|
462
475
|
|
|
@@ -483,7 +496,7 @@ type C = IsArray<string>;
|
|
|
483
496
|
*/
|
|
484
497
|
type UnknownArray = readonly unknown[];
|
|
485
498
|
//#endregion
|
|
486
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
499
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/type.d.ts
|
|
487
500
|
/**
|
|
488
501
|
Returns a boolean for whether A is false.
|
|
489
502
|
|
|
@@ -547,7 +560,7 @@ Indicates the value of `exactOptionalPropertyTypes` compiler option.
|
|
|
547
560
|
*/
|
|
548
561
|
type IsExactOptionalPropertyTypesEnabled = [(string | undefined)?] extends [string?] ? false : true;
|
|
549
562
|
//#endregion
|
|
550
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
563
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/array.d.ts
|
|
551
564
|
/**
|
|
552
565
|
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.
|
|
553
566
|
|
|
@@ -589,7 +602,7 @@ type _CollapseRestElement<TArray extends UnknownArray, ForwardAccumulator extend
|
|
|
589
602
|
: First], BackwardAccumulator> : never // Should never happen, since `[(infer First)?, ...infer Rest]` is a top-type for arrays.
|
|
590
603
|
: never; // Should never happen
|
|
591
604
|
//#endregion
|
|
592
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
605
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/characters.d.ts
|
|
593
606
|
type Whitespace = '\u{9}' // '\t'
|
|
594
607
|
| '\u{A}' // '\n'
|
|
595
608
|
| '\u{B}' // '\v'
|
|
@@ -603,7 +616,7 @@ type AsciiPunctuation = '!' | '"' | '#' | '$' | '%' | '&' | '\'' | '(' | ')' | '
|
|
|
603
616
|
//#region ../../node_modules/.pnpm/tagged-tag@1.0.0/node_modules/tagged-tag/index.d.ts
|
|
604
617
|
declare const tag: unique symbol;
|
|
605
618
|
//#endregion
|
|
606
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
619
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/tagged.d.ts
|
|
607
620
|
// eslint-disable-next-line type-fest/require-exported-types
|
|
608
621
|
type TagContainer<Token> = {
|
|
609
622
|
readonly [tag]: Token;
|
|
@@ -775,7 +788,7 @@ type Person = {
|
|
|
775
788
|
@deprecated Use {@link Tagged} instead
|
|
776
789
|
*/
|
|
777
790
|
//#endregion
|
|
778
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
791
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-literal.d.ts
|
|
779
792
|
/**
|
|
780
793
|
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).
|
|
781
794
|
|
|
@@ -837,7 +850,7 @@ type _IsStringLiteral<S> = // If `T` is an infinite string type (e.g., `on${stri
|
|
|
837
850
|
// and since `{}` extends index signatures, the result becomes `false`.
|
|
838
851
|
S extends string ? {} extends Record<S, never> ? false : true : false;
|
|
839
852
|
//#endregion
|
|
840
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
853
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/trim.d.ts
|
|
841
854
|
/**
|
|
842
855
|
Remove spaces from the left side.
|
|
843
856
|
*/
|
|
@@ -862,7 +875,7 @@ type Example = Trim<' foo '>;
|
|
|
862
875
|
*/
|
|
863
876
|
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
864
877
|
//#endregion
|
|
865
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
878
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/string.d.ts
|
|
866
879
|
/**
|
|
867
880
|
Returns a boolean for whether the given string `S` starts with the given string `SearchString`.
|
|
868
881
|
|
|
@@ -892,7 +905,7 @@ This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/mi
|
|
|
892
905
|
*/
|
|
893
906
|
type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
894
907
|
//#endregion
|
|
895
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
908
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/simplify.d.ts
|
|
896
909
|
/**
|
|
897
910
|
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.
|
|
898
911
|
|
|
@@ -953,7 +966,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
953
966
|
*/
|
|
954
967
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
955
968
|
//#endregion
|
|
956
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
969
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-equal.d.ts
|
|
957
970
|
/**
|
|
958
971
|
Returns a boolean for whether the two given types are equal.
|
|
959
972
|
|
|
@@ -984,7 +997,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
984
997
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
985
998
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
986
999
|
//#endregion
|
|
987
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1000
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
988
1001
|
/**
|
|
989
1002
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
990
1003
|
|
|
@@ -1078,7 +1091,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
1078
1091
|
*/
|
|
1079
1092
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
1080
1093
|
//#endregion
|
|
1081
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1094
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
1082
1095
|
/**
|
|
1083
1096
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
1084
1097
|
|
|
@@ -1126,7 +1139,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
1126
1139
|
*/
|
|
1127
1140
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
1128
1141
|
//#endregion
|
|
1129
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1142
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/merge.d.ts
|
|
1130
1143
|
// Merges two objects without worrying about index signatures.
|
|
1131
1144
|
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
1132
1145
|
/**
|
|
@@ -1198,7 +1211,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
|
|
|
1198
1211
|
// Should never happen
|
|
1199
1212
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
1200
1213
|
//#endregion
|
|
1201
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1214
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/object.d.ts
|
|
1202
1215
|
/**
|
|
1203
1216
|
Merges user specified options with default options.
|
|
1204
1217
|
|
|
@@ -1251,8 +1264,9 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
1251
1264
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
1252
1265
|
```
|
|
1253
1266
|
*/
|
|
1254
|
-
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> =
|
|
1255
|
-
|
|
1267
|
+
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> extends infer Result extends Required<Options> // `extends Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
|
|
1268
|
+
? Result : never;
|
|
1269
|
+
type _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Merge<Defaults, { [Key in keyof SpecifiedOptions as undefined extends Required<Options>[Key & keyof Options] ? Key : undefined extends SpecifiedOptions[Key] ? never : Key]: SpecifiedOptions[Key] }>>>;
|
|
1256
1270
|
/**
|
|
1257
1271
|
Collapses literal types in a union into their corresponding primitive types, when possible. For example, `CollapseLiterals<'foo' | 'bar' | (string & {})>` returns `string`.
|
|
1258
1272
|
|
|
@@ -1282,7 +1296,7 @@ type E = CollapseLiterals<LiteralUnion<'foo' | 'bar', string> | null | undefined
|
|
|
1282
1296
|
*/
|
|
1283
1297
|
type CollapseLiterals<T> = {} extends T ? T : T extends infer U & {} ? U : T;
|
|
1284
1298
|
//#endregion
|
|
1285
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1299
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/some-extend.d.ts
|
|
1286
1300
|
/**
|
|
1287
1301
|
@see {@link SomeExtend}
|
|
1288
1302
|
*/
|
|
@@ -1364,7 +1378,7 @@ type SomeExtend<TArray extends UnknownArray, Type, Options extends SomeExtendOpt
|
|
|
1364
1378
|
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`.
|
|
1365
1379
|
? true : _SomeExtend<Rest, Type, Options> : First extends Type ? true : _SomeExtend<Rest, Type, Options> : false, false, false>;
|
|
1366
1380
|
//#endregion
|
|
1367
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1381
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/or-all.d.ts
|
|
1368
1382
|
/**
|
|
1369
1383
|
Returns a boolean for whether any of the given elements is `true`.
|
|
1370
1384
|
|
|
@@ -1435,7 +1449,7 @@ Note: `OrAll<[]>` evaluates to `false` because there are no `true` elements in a
|
|
|
1435
1449
|
*/
|
|
1436
1450
|
type OrAll<T extends readonly boolean[]> = SomeExtend<T, true>;
|
|
1437
1451
|
//#endregion
|
|
1438
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1452
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/or.d.ts
|
|
1439
1453
|
/**
|
|
1440
1454
|
Returns a boolean for whether either of two given types is `true`.
|
|
1441
1455
|
|
|
@@ -1515,7 +1529,7 @@ type G = Or<never, never>;
|
|
|
1515
1529
|
*/
|
|
1516
1530
|
type Or<A extends boolean, B extends boolean> = OrAll<[A, B]>;
|
|
1517
1531
|
//#endregion
|
|
1518
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1532
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/all-extend.d.ts
|
|
1519
1533
|
/**
|
|
1520
1534
|
@see {@link AllExtend}
|
|
1521
1535
|
*/
|
|
@@ -1601,7 +1615,7 @@ type AllExtend<TArray extends UnknownArray, Type, Options extends AllExtendOptio
|
|
|
1601
1615
|
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.
|
|
1602
1616
|
? _AllExtend<Rest, Type, Options> : false : First extends Type ? _AllExtend<Rest, Type, Options> : false : true, false, false>;
|
|
1603
1617
|
//#endregion
|
|
1604
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1618
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/except.d.ts
|
|
1605
1619
|
/**
|
|
1606
1620
|
Filter out keys from an object.
|
|
1607
1621
|
|
|
@@ -1699,7 +1713,7 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
1699
1713
|
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
1700
1714
|
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>> : {});
|
|
1701
1715
|
//#endregion
|
|
1702
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1716
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/promisable.d.ts
|
|
1703
1717
|
/**
|
|
1704
1718
|
Create a type that represents either the value or the value wrapped in `PromiseLike`.
|
|
1705
1719
|
|
|
@@ -1726,7 +1740,7 @@ await logger(() => Promise.resolve('bar'));
|
|
|
1726
1740
|
*/
|
|
1727
1741
|
type Promisable<T> = T | PromiseLike<T>;
|
|
1728
1742
|
//#endregion
|
|
1729
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1743
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-lowercase.d.ts
|
|
1730
1744
|
/**
|
|
1731
1745
|
Returns a boolean for whether the given string literal is lowercase.
|
|
1732
1746
|
|
|
@@ -1754,7 +1768,7 @@ Returns a boolean for whether an individual part of the string is lowercase.
|
|
|
1754
1768
|
*/
|
|
1755
1769
|
type IsLowercaseHelper<S extends string> = S extends Lowercase<string> ? true : S extends Uppercase<string> | Capitalize<string> | `${string}${Uppercase<string>}${string}` ? false : boolean;
|
|
1756
1770
|
//#endregion
|
|
1757
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1771
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-uppercase.d.ts
|
|
1758
1772
|
/**
|
|
1759
1773
|
Returns a boolean for whether the given string literal is uppercase.
|
|
1760
1774
|
|
|
@@ -1782,7 +1796,7 @@ Returns a boolean for whether an individual part of the string is uppercase.
|
|
|
1782
1796
|
*/
|
|
1783
1797
|
type IsUppercaseHelper<S extends string> = S extends Uppercase<string> ? true : S extends Lowercase<string> | Uncapitalize<string> | `${string}${Lowercase<string>}${string}` ? false : boolean;
|
|
1784
1798
|
//#endregion
|
|
1785
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1799
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/words.d.ts
|
|
1786
1800
|
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
1787
1801
|
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
1788
1802
|
/**
|
|
@@ -1879,104 +1893,14 @@ type WordsImplementation<Sentence extends string, Options extends Required<Words
|
|
|
1879
1893
|
: [true, true] extends [IsUppercase<LastCharacter>, IsLowercase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...WordsImplementation<RemainingCharacters, Options, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] // No case change: concat word
|
|
1880
1894
|
: WordsImplementation<RemainingCharacters, Options, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
|
|
1881
1895
|
//#endregion
|
|
1882
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1883
|
-
/**
|
|
1884
|
-
@see {@link RemovePrefix}
|
|
1885
|
-
*/
|
|
1886
|
-
type RemovePrefixOptions = {
|
|
1887
|
-
/**
|
|
1888
|
-
When enabled, instantiations with non-literal prefixes (e.g., `string`, `Uppercase<string>`, `` `on${string}` ``) simply return `string`, since their precise structure cannot be statically determined.
|
|
1889
|
-
Note: Disabling this option can produce misleading results that might not reflect the actual runtime behavior.
|
|
1890
|
-
For example, ``RemovePrefix<'on-change', `${string}-`, {strict: false}>`` returns `'change'`, but at runtime, prefix could be `'handle-'` (which satisfies `` `${string}-` ``) and removing `'handle-'` from `'on-change'` would not result in `'change'`.
|
|
1891
|
-
So, it is recommended to not disable this option unless you are aware of the implications.
|
|
1892
|
-
@default true
|
|
1893
|
-
@example
|
|
1894
|
-
```
|
|
1895
|
-
import type {RemovePrefix} from 'type-fest';
|
|
1896
|
-
type A = RemovePrefix<'on-change', `${string}-`, {strict: true}>;
|
|
1897
|
-
//=> string
|
|
1898
|
-
type B = RemovePrefix<'on-change', `${string}-`, {strict: false}>;
|
|
1899
|
-
//=> 'change'
|
|
1900
|
-
type C = RemovePrefix<'on-change', string, {strict: true}>;
|
|
1901
|
-
//=> string
|
|
1902
|
-
type D = RemovePrefix<'on-change', string, {strict: false}>;
|
|
1903
|
-
//=> 'n-change'
|
|
1904
|
-
type E = RemovePrefix<`${string}/${number}`, `${string}/`, {strict: true}>;
|
|
1905
|
-
//=> string
|
|
1906
|
-
type F = RemovePrefix<`${string}/${number}`, `${string}/`, {strict: false}>;
|
|
1907
|
-
//=> `${number}`
|
|
1908
|
-
```
|
|
1909
|
-
Note: This option has no effect when only the input string type is non-literal. For example, ``RemovePrefix<`on-${string}`, 'on-'>`` will always return `string`.
|
|
1910
|
-
@example
|
|
1911
|
-
```
|
|
1912
|
-
import type {RemovePrefix} from 'type-fest';
|
|
1913
|
-
type A = RemovePrefix<`on-${string}`, 'on-', {strict: true}>;
|
|
1914
|
-
//=> string
|
|
1915
|
-
type B = RemovePrefix<`on-${string}`, 'on-', {strict: false}>;
|
|
1916
|
-
//=> string
|
|
1917
|
-
type C = RemovePrefix<`id-${number}`, 'id-', {strict: true}>;
|
|
1918
|
-
//=> `${number}`
|
|
1919
|
-
type D = RemovePrefix<`id-${number}`, 'id-', {strict: false}>;
|
|
1920
|
-
//=> `${number}`
|
|
1921
|
-
```
|
|
1922
|
-
Note: If it can be statically determined that the input string can never start with the specified non-literal prefix, then the input string is returned as-is, regardless of the value of this option.
|
|
1923
|
-
For example, ``RemovePrefix<`${string}/${number}`, `${string}:`>`` returns `` `${string}/${number}` ``, since a string of type `` `${string}/${number}` `` can never start with a prefix of type `` `${string}:` ``.
|
|
1924
|
-
```
|
|
1925
|
-
import type {RemovePrefix} from 'type-fest';
|
|
1926
|
-
type A = RemovePrefix<`${string}/${number}`, `${string}:`, {strict: true}>;
|
|
1927
|
-
//=> `${string}/${number}`
|
|
1928
|
-
type B = RemovePrefix<`${string}/${number}`, `${string}:`, {strict: false}>;
|
|
1929
|
-
//=> `${string}/${number}`
|
|
1930
|
-
type C = RemovePrefix<'on-change', `${number}-`, {strict: true}>;
|
|
1931
|
-
//=> 'on-change'
|
|
1932
|
-
type D = RemovePrefix<'on-change', `${number}-`, {strict: false}>;
|
|
1933
|
-
//=> 'on-change'
|
|
1934
|
-
```
|
|
1935
|
-
*/
|
|
1936
|
-
strict?: boolean;
|
|
1937
|
-
};
|
|
1938
|
-
type DefaultRemovePrefixOptions = {
|
|
1939
|
-
strict: true;
|
|
1940
|
-
};
|
|
1941
|
-
/**
|
|
1942
|
-
Remove the specified prefix from the start of a string.
|
|
1943
|
-
|
|
1944
|
-
@example
|
|
1945
|
-
```
|
|
1946
|
-
import type {RemovePrefix} from 'type-fest';
|
|
1947
|
-
|
|
1948
|
-
type A = RemovePrefix<'on-change', 'on-'>;
|
|
1949
|
-
//=> 'change'
|
|
1950
|
-
|
|
1951
|
-
type B = RemovePrefix<'sm:flex' | 'sm:p-4' | 'sm:gap-2', 'sm:'>;
|
|
1952
|
-
//=> 'flex' | 'p-4' | 'gap-2'
|
|
1953
|
-
|
|
1954
|
-
type C = RemovePrefix<'on-change', 'off-'>;
|
|
1955
|
-
//=> 'on-change'
|
|
1956
|
-
|
|
1957
|
-
type D = RemovePrefix<`handle${Capitalize<string>}`, 'handle'>;
|
|
1958
|
-
//=> Capitalize<string>
|
|
1959
|
-
```
|
|
1960
|
-
|
|
1961
|
-
@see {@link RemovePrefixOptions}
|
|
1962
|
-
|
|
1963
|
-
@category String
|
|
1964
|
-
@category Template literal
|
|
1965
|
-
*/
|
|
1966
|
-
type RemovePrefix<S extends string, Prefix extends string, Options extends RemovePrefixOptions = {}> = IfNotAnyOrNever<S, IfNotAnyOrNever<Prefix, _RemovePrefix<S, Prefix, ApplyDefaultOptions<RemovePrefixOptions, DefaultRemovePrefixOptions, Options>>, string, S>>;
|
|
1967
|
-
type _RemovePrefix<S extends string, Prefix extends string, Options extends Required<RemovePrefixOptions>> = Prefix extends string // For distributing `Prefix`
|
|
1968
|
-
? S extends `${Prefix}${infer Rest}` ? Or<IsStringLiteral<Prefix>, Not<Options['strict']>> extends true ? Rest : string // Fallback to `string` when `Prefix` is non-literal and `strict` is disabled
|
|
1969
|
-
: S // Return back `S` when `Prefix` is not present at the start of `S`
|
|
1970
|
-
: never;
|
|
1971
|
-
//#endregion
|
|
1972
|
-
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/delimiter-case.d.ts
|
|
1896
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/delimiter-case.d.ts
|
|
1973
1897
|
type _DefaultDelimiterCaseOptions = Merge<_DefaultWordsOptions, {
|
|
1974
1898
|
splitOnNumbers: false;
|
|
1975
1899
|
}>;
|
|
1976
1900
|
/**
|
|
1977
1901
|
Convert an array of words to delimiter case starting with a delimiter with input capitalization.
|
|
1978
1902
|
*/
|
|
1979
|
-
type DelimiterCaseFromArray<Words extends string[], Delimiter extends string, OutputString extends string = ''> = Words extends [infer FirstWord extends string, ...infer RemainingWords extends string[]] ? DelimiterCaseFromArray<RemainingWords, Delimiter, `${OutputString}${StartsWith<FirstWord, AsciiPunctuation> extends true ? '' : Delimiter}${FirstWord}`> : OutputString;
|
|
1903
|
+
type DelimiterCaseFromArray<Words extends string[], Delimiter extends string, OutputString extends string = ''> = Words extends [infer FirstWord extends string, ...infer RemainingWords extends string[]] ? DelimiterCaseFromArray<RemainingWords, Delimiter, OutputString extends '' ? FirstWord : `${OutputString}${StartsWith<FirstWord, AsciiPunctuation> extends true ? '' : Delimiter}${FirstWord}`> : OutputString;
|
|
1980
1904
|
/**
|
|
1981
1905
|
Convert a string literal to a custom string delimiter casing.
|
|
1982
1906
|
|
|
@@ -2017,11 +1941,10 @@ const rawCliOptions: OddlyCasedProperties<SomeOptions> = {
|
|
|
2017
1941
|
@category Change case
|
|
2018
1942
|
@category Template literal
|
|
2019
1943
|
*/
|
|
2020
|
-
type DelimiterCase<Value, Delimiter extends string, Options extends WordsOptions = {}> = Value extends string ?
|
|
2021
|
-
|
|
2022
|
-
}>> : Value;
|
|
1944
|
+
type DelimiterCase<Value, Delimiter extends string, Options extends WordsOptions = {}> = Value extends string ? Delimiter extends string // For distributing `Delimiter`
|
|
1945
|
+
? IsStringLiteral<Value> extends false ? Value : Lowercase<DelimiterCaseFromArray<Words<Value, ApplyDefaultOptions<WordsOptions, _DefaultDelimiterCaseOptions, Options>>, Delimiter>> : never : Value;
|
|
2023
1946
|
//#endregion
|
|
2024
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1947
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/kebab-case.d.ts
|
|
2025
1948
|
/**
|
|
2026
1949
|
Convert a string literal to kebab-case.
|
|
2027
1950
|
|
|
@@ -2077,6 +2000,7 @@ interface WithMetadata<TBase extends Class<NonNullable<unknown>>> {
|
|
|
2077
2000
|
}
|
|
2078
2001
|
//#endregion
|
|
2079
2002
|
//#region src/services/app/constants.d.ts
|
|
2003
|
+
declare const MAX_READ_LIMIT = 1e3;
|
|
2080
2004
|
declare const SITE_NAME = "Esposter";
|
|
2081
2005
|
//#endregion
|
|
2082
2006
|
//#region ../../node_modules/.pnpm/neverthrow@8.2.0/node_modules/neverthrow/dist/index.d.ts
|
|
@@ -2391,8 +2315,12 @@ declare const withFinalizer: <T>(fn: () => T, finalizer?: () => void) => T;
|
|
|
2391
2315
|
//#region src/services/error/withFinalizerAsync.d.ts
|
|
2392
2316
|
declare const withFinalizerAsync: <T>(fn: () => Promisable<T>, finalizer?: () => Promisable<void>) => Promise<T>;
|
|
2393
2317
|
//#endregion
|
|
2318
|
+
//#region src/services/message/classifyMentions.d.ts
|
|
2319
|
+
declare const classifyMentions: (message: string) => ClassifiedMentions;
|
|
2320
|
+
//#endregion
|
|
2394
2321
|
//#region src/services/message/constants.d.ts
|
|
2395
2322
|
declare const MENTION_ID_ATTRIBUTE = "data-id";
|
|
2323
|
+
declare const MENTION_ITEM_TYPE_ATTRIBUTE = "data-mention-type";
|
|
2396
2324
|
declare const MENTION_LABEL_ATTRIBUTE = "data-label";
|
|
2397
2325
|
declare const MENTION_TYPE_ATTRIBUTE = "data-type";
|
|
2398
2326
|
declare const MENTION_TYPE = "mention";
|
|
@@ -2813,4 +2741,4 @@ declare const UUIDV4_REGEX: RegExp;
|
|
|
2813
2741
|
//#region src/util/id/uuid/uuidValidateV4.d.ts
|
|
2814
2742
|
declare const uuidValidateV4: (uuid: string) => boolean;
|
|
2815
2743
|
//#endregion
|
|
2816
|
-
export { AllSpecialValues, BuildTuple, DeepOmit, DeepOptionalUndefined, ExcludeFunctionProperties, ForbiddenError, FunctionProperties, GetArrayProps, GetObjectProps, GetPaths, GetPrimitiveProps, GetProperties, ID_SEPARATOR, InvalidOperationError, ItemEntityType, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KnownKeys, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MapValue, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, PropertyNames, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, SkipFirst, TakeFirst, TakeOne, ToData, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, WithMetadata, applyItemMetadataMixin, capitalize, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, getResult, getResultAsync, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4, withFinalizer, withFinalizerAsync };
|
|
2744
|
+
export { AllSpecialValues, BuildTuple, ClassifiedMentions, DeepOmit, DeepOptionalUndefined, ExcludeFunctionProperties, ForbiddenError, FunctionProperties, GetArrayProps, GetObjectProps, GetPaths, GetPrimitiveProps, GetProperties, ID_SEPARATOR, InvalidOperationError, ItemEntityType, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KnownKeys, MAX_READ_LIMIT, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MapValue, MentionType, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, PropertyNames, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, SkipFirst, TakeFirst, TakeOne, ToData, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, WithMetadata, applyItemMetadataMixin, capitalize, classifyMentions, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, getResult, getResultAsync, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4, withFinalizer, withFinalizerAsync };
|