Import "Build a weather server" quickstart guide (#1549)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Hefner 2026-02-17 18:06:12 -06:00 • committed by GitHub
commit 6cd75c67ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -209,8 +209,6 @@ function findLabeledCodeFences(
* @returns The dedented content
*/
function dedent(content: string, baseIndent: string): string {
if (!baseIndent) return content;
const lines = content.split('\n');
const dedentedLines = lines.map((line) => {
// Preserve empty lines as-is
@ -314,7 +312,7 @@ function getOrLoadRegion(
if (fileContent === undefined) {
try {
fileContent = readFileSync(absoluteExamplePath, 'utf-8').trim();
fileContent = readFileSync(absoluteExamplePath, 'utf-8');
} catch {
throw new Error(`Example file not found: ${absoluteExamplePath}`);
}
@ -323,7 +321,7 @@ function getOrLoadRegion(
// If no region name, return whole file
if (!regionName) {
return fileContent;
return fileContent.trim();
}
// Extract region from cached file content, cache the result