Skip to content
File

Blob: src/workerd/api/tests/new-module-registry-ts-test-helper.ts

typescript17 lines
1// Copyright (c) 2026 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4// A simple TypeScript module with type annotations that will be stripped
5// by the transpiler. This exercises the code path where EsModule source
6// is owned by a rust::String from the transpiler output.
7 
8export function add(a: number, b: number): number {
9 return a + b;
10}
11 
12export function greet(name: string): string {
13 return `hello, ${name}`;
14}
15 
16export const PI: number = 3.14159;