@jsenv/core 39.9.5 → 39.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14503,11 +14503,15 @@ const createUrlInfoTransformer = ({
14503
14503
  if (!generatedUrl.startsWith("file:")) {
14504
14504
  return;
14505
14505
  }
14506
- if (
14507
- urlInfo.type === "directory" ||
14508
- // happens when type is "html" to list directory content for example
14509
- urlInfo.firstReference?.fsStat?.isDirectory()
14510
- ) {
14506
+ if (urlToPathname$1(generatedUrl).endsWith("/")) {
14507
+ // when users explicitely request a directory
14508
+ // we can't write the content returned by the server in ".jsenv" at that url
14509
+ // because it would try to write a directory
14510
+ // ideally we would decide a filename for this
14511
+ // for now we just don't write anything
14512
+ return;
14513
+ }
14514
+ if (urlInfo.type === "directory") {
14511
14515
  // no need to write the directory
14512
14516
  return;
14513
14517
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "39.9.5",
3
+ "version": "39.9.6",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -4,7 +4,7 @@ import {
4
4
  generateSourcemapDataUrl,
5
5
  SOURCEMAP,
6
6
  } from "@jsenv/sourcemap";
7
- import { isFileSystemPath, urlToRelativeUrl } from "@jsenv/urls";
7
+ import { isFileSystemPath, urlToPathname, urlToRelativeUrl } from "@jsenv/urls";
8
8
  import { pathToFileURL } from "node:url";
9
9
  import {
10
10
  defineGettersOnPropertiesDerivedFromContent,
@@ -251,11 +251,15 @@ export const createUrlInfoTransformer = ({
251
251
  if (!generatedUrl.startsWith("file:")) {
252
252
  return;
253
253
  }
254
- if (
255
- urlInfo.type === "directory" ||
256
- // happens when type is "html" to list directory content for example
257
- urlInfo.firstReference?.fsStat?.isDirectory()
258
- ) {
254
+ if (urlToPathname(generatedUrl).endsWith("/")) {
255
+ // when users explicitely request a directory
256
+ // we can't write the content returned by the server in ".jsenv" at that url
257
+ // because it would try to write a directory
258
+ // ideally we would decide a filename for this
259
+ // for now we just don't write anything
260
+ return;
261
+ }
262
+ if (urlInfo.type === "directory") {
259
263
  // no need to write the directory
260
264
  return;
261
265
  }