This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type OmitDeep<T, K extends string> = T extends undefined | |
? undefined | |
: K extends `${infer Head}.${infer Tail}` | |
? Head extends keyof T | |
? { | |
[P in keyof T]: P extends Head ? OmitDeep<T[P], Tail> : T[P]; | |
} | |
: T | |
: Omit<T, K>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import clsx from 'clsx'; | |
import { getDisplayName, __DEV__ } from '@/utils/helpers'; | |
export type withClassNameProps = { | |
className?: string; | |
}; | |
export function withClassName<T, P extends object>( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function withClassName<Props extends object>( | |
WrappedComponent: | |
| React.ComponentType<Props> | |
| React.ForwardRefExoticComponent<Props>, | |
classes?: string, | |
) { | |
const WithClassName = (props: Props & { className?: string }) => | |
React.createElement(WrappedComponent, { | |
...props, | |
className: clsx(props.className, classes), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
ArgumentMetadata, | |
HttpStatus, | |
Injectable, | |
Optional, | |
PipeTransform | |
} from '@nestjs/common'; | |
import { | |
ErrorHttpStatusCode, | |
HttpErrorByCode |