temoncher
Follow
🐢
- Russia, Yaroslavl
- @temoncher
Block or Report
Block or report temoncher
Report abuse
Contact GitHub support about this user’s behavior. Learn more about reporting abuse.
Report abusePinned
-
-
-
jsx tagged template for inline text
jsx tagged template for inline text 1/**
2* @example
3*
4* const red = (text) => <span style={{ backgroundColor: 'red', color: 'white', padding: '8px' }}>{text}</span>;
5*
-
`isEnum` typeguard
`isEnum` typeguard 1export const isEnum = <T extends string | number, TEnumValue extends string>(enumVariable: { [key in T]: TEnumValue }) => {
2const enumValues = Object.values(enumVariable);
34return (value: unknown): value is TEnumValue => (typeof value === 'string' || typeof value === 'number') && enumValues.includes(value);
5};
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.