diff options
Diffstat (limited to 'packages/bun-debug-adapter-protocol/debugger/fixtures/with-sourcemap.ts')
-rw-r--r-- | packages/bun-debug-adapter-protocol/debugger/fixtures/with-sourcemap.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/packages/bun-debug-adapter-protocol/debugger/fixtures/with-sourcemap.ts b/packages/bun-debug-adapter-protocol/debugger/fixtures/with-sourcemap.ts new file mode 100644 index 000000000..f245ebf76 --- /dev/null +++ b/packages/bun-debug-adapter-protocol/debugger/fixtures/with-sourcemap.ts @@ -0,0 +1,46 @@ +export default { + fetch(request: Request): Response { + const animal = getAnimal(request.url); + const voice = animal.talk(); + return new Response(voice); + }, +}; + +function getAnimal(query: string): Animal { + switch (query.split("/").pop()) { + case "dog": + return new Dog(); + case "cat": + return new Cat(); + } + return new Bird(); +} + +interface Animal { + readonly name: string; + talk(): string; +} + +class Dog implements Animal { + name = "dog"; + + talk(): string { + return "woof"; + } +} + +class Cat implements Animal { + name = "cat"; + + talk(): string { + return "meow"; + } +} + +class Bird implements Animal { + name = "bird"; + + talk(): string { + return "chirp"; + } +} |