temoncher
Follow
Pinned Loading
-
-
babel-plugin-log-expressions
babel-plugin-log-expressions PublicYou will never have to write console.log again!
JavaScript 2
-
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.