@lwrjs/shared-utils 0.10.0-alpha.19 → 0.10.0-alpha.20

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.
package/build/cjs/fs.cjs CHANGED
@@ -147,7 +147,10 @@ function normalizeAssetSpecifier(assetId, assetPathMap, resourcePaths, basePath)
147
147
  }
148
148
  for (const [urlPath, fsPath] of assetPathMap.entries()) {
149
149
  const slashPath = urlPath.endsWith("/") ? urlPath : `${urlPath}/`;
150
- if (specifier.startsWith(slashPath) || specifier === urlPath) {
150
+ const fsSlashPath = fsPath.endsWith("/") ? fsPath : `${fsPath}/`;
151
+ if (specifier.startsWith(slashPath)) {
152
+ return specifier.replace(slashPath, fsSlashPath);
153
+ } else if (specifier === urlPath) {
151
154
  return specifier.replace(urlPath, fsPath);
152
155
  }
153
156
  }
package/build/es/fs.js CHANGED
@@ -158,7 +158,13 @@ export function normalizeAssetSpecifier(assetId, assetPathMap, resourcePaths, ba
158
158
  // - Individual files: the asset specifier is equal to a configured assets[i].urlPath
159
159
  for (const [urlPath, fsPath] of assetPathMap.entries()) {
160
160
  const slashPath = urlPath.endsWith('/') ? urlPath : `${urlPath}/`;
161
- if (specifier.startsWith(slashPath) || specifier === urlPath) {
161
+ const fsSlashPath = fsPath.endsWith('/') ? fsPath : `${fsPath}/`;
162
+ // Matches directory
163
+ if (specifier.startsWith(slashPath)) {
164
+ return specifier.replace(slashPath, fsSlashPath);
165
+ // Matches File
166
+ }
167
+ else if (specifier === urlPath) {
162
168
  return specifier.replace(urlPath, fsPath);
163
169
  }
164
170
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.10.0-alpha.19",
7
+ "version": "0.10.0-alpha.20",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -62,13 +62,13 @@
62
62
  "rollup": "^2.78.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@lwrjs/diagnostics": "0.10.0-alpha.19",
66
- "@lwrjs/types": "0.10.0-alpha.19",
65
+ "@lwrjs/diagnostics": "0.10.0-alpha.20",
66
+ "@lwrjs/types": "0.10.0-alpha.20",
67
67
  "@types/mime-types": "2.1.1",
68
68
  "@types/path-to-regexp": "^1.7.0"
69
69
  },
70
70
  "engines": {
71
71
  "node": ">=16.0.0"
72
72
  },
73
- "gitHead": "0bd55139c08ddf5a532978cfa9e037eaf27e78e2"
73
+ "gitHead": "45a867fc54e98f77dd442ccd5f668e23027b9246"
74
74
  }