Solarized-light-hockor
Publisher: hockorThemes in package: 1
Based on Solarized light fjs and tailored for functional programming style in JavaScript
Based on Solarized light fjs and tailored for functional programming style in JavaScript
Full workbench mockup using this variant's colors and tokenColors.
Loading...
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| — | #586E75 | — |
| comment | #999999 | italic |
| string | #0959B5 | — |
| string.regexp | #D30102 | — |
| constant.numeric | #D33682 | — |
| variable.language, variable.other | #265CD1 | — |
| keyword | #CF135E | — |
| storage | #094DB3 | — |
| entity.name.class, entity.name.type.class | #1B53BD | — |
| entity.name.function | #B35804 | — |
| punctuation.definition.variable | #859900 | — |
| punctuation.section.embedded.begin, punctuation.section.embedded.end | #D30102 | — |
| constant.language, meta.preprocessor | #B58900 | — |
| support.function.construct, keyword.other.new | #D30102 | — |
| constant.character, constant.other | #CB4B16 | — |
| entity.other.inherited-class | — | — |
| variable.parameter | #D10000 | — |
| entity.name.tag | #2076B3 | — |
| punctuation.definition.tag.begin, punctuation.definition.tag.end | #D6501C | — |
| entity.other.attribute-name | #93A1A1 | — |
| support.function | #cb6622 | — |
| punctuation.separator.continuation | #D30102 | — |
| support.constant | #0C57C9 | — |
| support.type, support.class | #00991F | — |
| support.type.exception | #CB4B16 | — |
| support.other.variable | — | — |
| invalid | — | — |
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}