Skip to content
File

Blob: build/typescript.bzl

490 bytes
1def module_name(ts_name):
2 if ts_name.endswith(".ts"):
3 return ts_name.removesuffix(".ts")
4 if ts_name.endswith(".mts"):
5 return ts_name.removesuffix(".mts")
6 fail("Expected TypeScript source file, got " + ts_name)
7 
8def js_name(ts_name):
9 if ts_name.endswith(".ts"):
10 return ts_name.removesuffix(".ts") + ".js"
11 if ts_name.endswith(".mts"):
12 return ts_name.removesuffix(".mts") + ".mjs"
13 fail("Expected TypeScript source file, got " + ts_name)