diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-01-23 23:51:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-23 23:51:07 +0100 |
| commit | 60688c563e6d02813b021ad91132fe1eb3f103b6 (patch) | |
| tree | 89e7862fa34a8e93cebed984ee5cfa44011d4230 /cli/tests/testdata/run/import_meta/main.out | |
| parent | 13d5c6420e3fe7f34e7c02a96922fe8db381503e (diff) | |
feat: import.meta.filename and import.meta.dirname (#22061)
This commit adds `import.meta.filename` and `import.meta.dirname` APIs.
These APIs return string representation of filename and containing
dirname.
They are only defined for local modules (modules that have `file:///`
scheme).
Example:
```ts
console.log(import.meta.filename, import.meta.dirname)
```
Unix:
```
$ deno run /dev/my_module.ts
/dev/my_module.ts /dev/
```
Windows:
```
$ deno run C:\dev\my_module.ts
C:\dev\my_module.ts C:\
```
Diffstat (limited to 'cli/tests/testdata/run/import_meta/main.out')
| -rw-r--r-- | cli/tests/testdata/run/import_meta/main.out | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/tests/testdata/run/import_meta/main.out b/cli/tests/testdata/run/import_meta/main.out index 0329dea8a..5a86d6240 100644 --- a/cli/tests/testdata/run/import_meta/main.out +++ b/cli/tests/testdata/run/import_meta/main.out @@ -1,5 +1,6 @@ -other [WILDCARD]other.ts false -main [WILDCARD]main.ts true +other remote [WILDCARD]other.ts false undefined undefined +other [WILDCARD]other.ts false [WILDCARD]other.ts [WILDCARD] +main [WILDCARD]main.ts true [WILDCARD]main.ts [WILDCARD] Resolving ./foo.js file:///[WILDCARD]/foo.js Resolving bare from import map https://example.com/ Resolving https://example.com/rewrite from import map https://example.com/rewritten |
