@lwrjs/shared-utils 0.7.0-alpha.2 → 0.7.0-alpha.5

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.
@@ -218,10 +218,9 @@ function getModuleIdentity(req) {
218
218
  }
219
219
  function getMappingIdentity(req) {
220
220
  const {specifiers} = req.params;
221
- const modifiers = req.query.importer ? {importer: decodeURIComponent(req.query.importer)} : {};
222
221
  const moduleIds = explodeSpecifiers(specifiers).map((obj) => ({
223
222
  ...obj,
224
- ...modifiers
223
+ importer: req.query.importer
225
224
  }));
226
225
  return {
227
226
  moduleIds
@@ -46,8 +46,8 @@ async function getImportMetadataMappings(moduleIds, runtimeEnvironment, runtimeP
46
46
  const moduleGraph = await (0, import_graph.getModuleGraphs)(specifier, {includeUris: true, includeLinkedDefinitions: true, depth}, moduleRegistry, runtimeEnvironment.bundle ? moduleBundler : moduleRegistry, runtimeEnvironment, runtimeParams, visitedCache);
47
47
  importMetadata = await toImportMetadata(moduleGraph, importMetadata, moduleRegistry, runtimeEnvironment, runtimeParams);
48
48
  }
49
- if (requestedSpecifier !== specifier && moduleId.importer) {
50
- const requestedSpecifierPlusImporter = `${requestedSpecifier}?importer=${encodeURIComponent(moduleId.importer)}`;
49
+ if (requestedSpecifier !== specifier) {
50
+ const requestedSpecifierPlusImporter = `${requestedSpecifier}?importer=${moduleId.importer}`;
51
51
  const specifiersArray = Object.values(importMetadata.imports).find((a) => a.includes(specifier));
52
52
  if (!specifiersArray) {
53
53
  throw new Error("Could not find: " + specifier + " in " + JSON.stringify(importMetadata.imports));
@@ -281,10 +281,9 @@ export function getModuleIdentity(req) {
281
281
  }
282
282
  export function getMappingIdentity(req) {
283
283
  const { specifiers } = req.params;
284
- const modifiers = req.query.importer ? { importer: decodeURIComponent(req.query.importer) } : {};
285
284
  const moduleIds = explodeSpecifiers(specifiers).map((obj) => ({
286
285
  ...obj,
287
- ...modifiers,
286
+ importer: req.query.importer,
288
287
  }));
289
288
  return {
290
289
  moduleIds,
@@ -30,8 +30,8 @@ export async function getImportMetadataMappings(moduleIds, runtimeEnvironment, r
30
30
  importMetadata = await toImportMetadata(moduleGraph, importMetadata, moduleRegistry, runtimeEnvironment, runtimeParams);
31
31
  }
32
32
  // If the requested specifier is not the same as the versioned specifier, include the requested specifier's importer.
33
- if (requestedSpecifier !== specifier && moduleId.importer) {
34
- const requestedSpecifierPlusImporter = `${requestedSpecifier}?importer=${encodeURIComponent(moduleId.importer)}`;
33
+ if (requestedSpecifier !== specifier) {
34
+ const requestedSpecifierPlusImporter = `${requestedSpecifier}?importer=${moduleId.importer}`;
35
35
  const specifiersArray = Object.values(importMetadata.imports).find((a) => a.includes(specifier));
36
36
  if (!specifiersArray) {
37
37
  throw new Error('Could not find: ' + specifier + ' in ' + JSON.stringify(importMetadata.imports));
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.7.0-alpha.2",
7
+ "version": "0.7.0-alpha.5",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -43,13 +43,13 @@
43
43
  "slugify": "^1.4.5"
44
44
  },
45
45
  "devDependencies": {
46
- "@lwrjs/diagnostics": "0.7.0-alpha.2",
47
- "@lwrjs/types": "0.7.0-alpha.2",
46
+ "@lwrjs/diagnostics": "0.7.0-alpha.5",
47
+ "@lwrjs/types": "0.7.0-alpha.5",
48
48
  "@types/mime-types": "2.1.1",
49
49
  "@types/path-to-regexp": "^1.7.0"
50
50
  },
51
51
  "engines": {
52
52
  "node": ">=14.15.4 <17"
53
53
  },
54
- "gitHead": "fc3a13d1c5440833eb2ec17fbf0e294554bafa08"
54
+ "gitHead": "4be785ee5e0da8fbbf29bf18993bbd77febf5a2c"
55
55
  }