summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/npm/cjs-invalid-name-exports
diff options
context:
space:
mode:
authorawait-ovo <13152410380@163.com>2023-07-04 02:41:09 +0800
committerGitHub <noreply@github.com>2023-07-03 18:41:09 +0000
commit208e65d33a6eed09404ecb0bc6858ce95c754f81 (patch)
treeb8150630e110013379fa292b2145b819d28f4b2c /cli/tests/testdata/npm/cjs-invalid-name-exports
parentd632cce129cb7025a34cf0aa7262a38fb12f47c4 (diff)
fix(npm): escape export identifier in double quoted string (#19694)
Diffstat (limited to 'cli/tests/testdata/npm/cjs-invalid-name-exports')
-rw-r--r--cli/tests/testdata/npm/cjs-invalid-name-exports/main.out13
-rw-r--r--cli/tests/testdata/npm/cjs-invalid-name-exports/main.ts3
2 files changed, 16 insertions, 0 deletions
diff --git a/cli/tests/testdata/npm/cjs-invalid-name-exports/main.out b/cli/tests/testdata/npm/cjs-invalid-name-exports/main.out
new file mode 100644
index 000000000..45ec15d0e
--- /dev/null
+++ b/cli/tests/testdata/npm/cjs-invalid-name-exports/main.out
@@ -0,0 +1,13 @@
+[Module: null prototype] {
+ "a \\ b": "a \\ b",
+ "another 'case'": "example",
+ default: {
+ 'wow "double quotes"': "double quotes",
+ "another 'case'": "example",
+ "a \\ b": "a \\ b",
+ "name variable": "a",
+ "foo - bar": "foo - bar"
+ },
+ "foo - bar": "foo - bar",
+ 'wow "double quotes"': "double quotes"
+}
diff --git a/cli/tests/testdata/npm/cjs-invalid-name-exports/main.ts b/cli/tests/testdata/npm/cjs-invalid-name-exports/main.ts
new file mode 100644
index 000000000..9bdf0e43b
--- /dev/null
+++ b/cli/tests/testdata/npm/cjs-invalid-name-exports/main.ts
@@ -0,0 +1,3 @@
+import * as foo from "npm:@denotest/cjs-invalid-name-exports";
+
+console.log(foo);