yanki 2.0.8 → 2.0.10
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/bin/cli.js +136 -137
- package/dist/lib/index.js +364 -330
- package/dist/standalone/index.d.ts +46 -17
- package/dist/standalone/index.js +152 -152
- package/package.json +25 -25
- package/readme.md +6 -2
- /package/dist/bin/{open-CC1xuL9n.js → open-PkGTdlsi.js} +0 -0
- /package/dist/standalone/{open-DsJJlGt1.js → open-DnUwqK4E.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
1
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/primitive.d.ts
|
|
2
2
|
/**
|
|
3
3
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
|
|
|
6
6
|
*/
|
|
7
7
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
8
8
|
//#endregion
|
|
9
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
9
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-any.d.ts
|
|
10
10
|
/**
|
|
11
11
|
Returns a boolean for whether the given type is `any`.
|
|
12
12
|
|
|
@@ -37,7 +37,7 @@ const anyA = get(anyObject, 'a');
|
|
|
37
37
|
*/
|
|
38
38
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
39
39
|
//#endregion
|
|
40
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
40
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
41
41
|
/**
|
|
42
42
|
Returns a boolean for whether the given key is an optional key of type.
|
|
43
43
|
|
|
@@ -80,7 +80,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
80
80
|
*/
|
|
81
81
|
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;
|
|
82
82
|
//#endregion
|
|
83
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
83
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
84
84
|
/**
|
|
85
85
|
Extract all optional keys from the given type.
|
|
86
86
|
|
|
@@ -118,7 +118,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
118
118
|
? (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`
|
|
119
119
|
: never;
|
|
120
120
|
//#endregion
|
|
121
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
121
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
122
122
|
/**
|
|
123
123
|
Extract all required keys from the given type.
|
|
124
124
|
|
|
@@ -152,7 +152,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
152
152
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
153
153
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
154
154
|
//#endregion
|
|
155
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
155
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-never.d.ts
|
|
156
156
|
/**
|
|
157
157
|
Returns a boolean for whether the given type is `never`.
|
|
158
158
|
|
|
@@ -208,7 +208,7 @@ type B = IsTrueFixed<never>;
|
|
|
208
208
|
*/
|
|
209
209
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
210
210
|
//#endregion
|
|
211
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
211
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/if.d.ts
|
|
212
212
|
/**
|
|
213
213
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
214
214
|
|
|
@@ -303,7 +303,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
303
303
|
*/
|
|
304
304
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
305
305
|
//#endregion
|
|
306
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
306
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/internal/type.d.ts
|
|
307
307
|
/**
|
|
308
308
|
Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
309
309
|
*/
|
|
@@ -321,7 +321,7 @@ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T
|
|
|
321
321
|
(...arguments_: infer B): unknown;
|
|
322
322
|
} ? B extends A ? A extends B ? false : true : true : false;
|
|
323
323
|
//#endregion
|
|
324
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
324
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/simplify.d.ts
|
|
325
325
|
/**
|
|
326
326
|
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.
|
|
327
327
|
|
|
@@ -382,7 +382,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
382
382
|
*/
|
|
383
383
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
384
384
|
//#endregion
|
|
385
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
385
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-equal.d.ts
|
|
386
386
|
/**
|
|
387
387
|
Returns a boolean for whether the two given types are equal.
|
|
388
388
|
|
|
@@ -413,7 +413,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
413
413
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
414
414
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
415
415
|
//#endregion
|
|
416
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
416
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
417
417
|
/**
|
|
418
418
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
419
419
|
|
|
@@ -507,7 +507,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
507
507
|
*/
|
|
508
508
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
509
509
|
//#endregion
|
|
510
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
510
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
511
511
|
/**
|
|
512
512
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
513
513
|
|
|
@@ -555,7 +555,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
555
555
|
*/
|
|
556
556
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
557
557
|
//#endregion
|
|
558
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
558
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/merge.d.ts
|
|
559
559
|
// Merges two objects without worrying about index signatures.
|
|
560
560
|
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
561
561
|
/**
|
|
@@ -627,7 +627,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
|
|
|
627
627
|
// Should never happen
|
|
628
628
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
629
629
|
//#endregion
|
|
630
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
630
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/internal/object.d.ts
|
|
631
631
|
/**
|
|
632
632
|
Merges user specified options with default options.
|
|
633
633
|
|
|
@@ -680,9 +680,38 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
680
680
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
681
681
|
```
|
|
682
682
|
*/
|
|
683
|
-
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> =
|
|
683
|
+
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>`
|
|
684
|
+
? Result : never;
|
|
685
|
+
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] }>>>;
|
|
686
|
+
/**
|
|
687
|
+
Collapses literal types in a union into their corresponding primitive types, when possible. For example, `CollapseLiterals<'foo' | 'bar' | (string & {})>` returns `string`.
|
|
688
|
+
|
|
689
|
+
Note: This doesn't collapse literals within tagged types. For example, `CollapseLiterals<Tagged<'foo' | (string & {}), 'Tag'>>` returns `("foo" & Tag<"Tag", never>) | (string & Tag<"Tag", never>)` and not `string & Tag<"Tag", never>`.
|
|
690
|
+
|
|
691
|
+
Use-case: For collapsing unions created using {@link LiteralUnion}.
|
|
692
|
+
|
|
693
|
+
@example
|
|
694
|
+
```
|
|
695
|
+
import type {LiteralUnion} from 'type-fest';
|
|
696
|
+
|
|
697
|
+
type A = CollapseLiterals<'foo' | 'bar' | (string & {})>;
|
|
698
|
+
//=> string
|
|
699
|
+
|
|
700
|
+
type B = CollapseLiterals<LiteralUnion<1 | 2 | 3, number>>;
|
|
701
|
+
//=> number
|
|
702
|
+
|
|
703
|
+
type C = CollapseLiterals<LiteralUnion<'onClick' | 'onChange', `on${string}`>>;
|
|
704
|
+
//=> `on${string}`
|
|
705
|
+
|
|
706
|
+
type D = CollapseLiterals<'click' | 'change' | (`on${string}` & {})>;
|
|
707
|
+
//=> 'click' | 'change' | `on${string}`
|
|
708
|
+
|
|
709
|
+
type E = CollapseLiterals<LiteralUnion<'foo' | 'bar', string> | null | undefined>;
|
|
710
|
+
//=> string | null | undefined
|
|
711
|
+
```
|
|
712
|
+
*/
|
|
684
713
|
//#endregion
|
|
685
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
714
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/partial-deep.d.ts
|
|
686
715
|
/**
|
|
687
716
|
@see {@link PartialDeep}
|
|
688
717
|
*/
|
|
@@ -796,7 +825,7 @@ Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for
|
|
|
796
825
|
*/
|
|
797
826
|
type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = { [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options> };
|
|
798
827
|
//#endregion
|
|
799
|
-
//#region node_modules/.pnpm/yanki-connect@4.0.
|
|
828
|
+
//#region node_modules/.pnpm/yanki-connect@4.0.6/node_modules/yanki-connect/dist/index.d.ts
|
|
800
829
|
//#region src/types/deck.d.ts
|
|
801
830
|
type DeckStats = {
|
|
802
831
|
deck_id: number;
|