13 lines
419 B
TypeScript
13 lines
419 B
TypeScript
/**
|
|
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
* @param defaultProps
|
|
* @param props
|
|
* @returns resolved props
|
|
*/
|
|
export default function resolveProps<T extends {
|
|
components?: Record<string, unknown>;
|
|
componentsProps?: Record<string, unknown>;
|
|
slots?: Record<string, unknown>;
|
|
slotProps?: Record<string, unknown>;
|
|
} & Record<string, unknown>>(defaultProps: T, props: T): T;
|