We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b18400 commit 7b4f7a4Copy full SHA for 7b4f7a4
packages/core/src/types.ts
@@ -24,8 +24,11 @@ import type { UnpluginOptions } from 'unplugin';
24
25
import type { ALL_ENVS, FULL_NAME_BUNDLERS, SUPPORTED_BUNDLERS } from './constants';
26
27
+// Re-assign B into A.
28
export type Assign<A, B> = Omit<A, keyof B> & B;
-export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
29
+// Type object with specified keys required.
30
+export type Ensure<T, K extends keyof T> = Assign<T, Required<Pick<T, K>>>;
31
+// Target one item from an iterable.
32
export type IterableElement<IterableType extends Iterable<unknown>> =
33
IterableType extends Iterable<infer ElementType> ? ElementType : never;
34
0 commit comments