@teleporthq/teleport-shared
Advanced tools
Comparing version
@@ -117,16 +117,20 @@ "use strict"; | ||
/* | ||
If the value from the mapping is an empty string | ||
we need to not join it in the return path as it would append | ||
a wrong / | ||
*/ | ||
if (!mappings[assetName]) { | ||
need to use either the original or decoded assetName to retrieve its mapping if there is one | ||
*/ | ||
var assetNameUsedForMapping = typeof mappings[assetName] === 'string' ? assetName : decodedAssetName; | ||
/* | ||
If the value from the mapping is an empty string | ||
we need to not join it in the return path as it would append | ||
a wrong / | ||
*/ | ||
if (!mappings[assetNameUsedForMapping]) { | ||
if (!identifier) { | ||
return [prefix, assetName].join('/'); | ||
return [prefix, assetNameUsedForMapping].join('/'); | ||
} | ||
return [prefix, identifier, assetName].join('/'); | ||
return [prefix, identifier, assetNameUsedForMapping].join('/'); | ||
} | ||
if (!identifier) { | ||
return [prefix, mappings[assetName], assetName].join('/'); | ||
return [prefix, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/'); | ||
} | ||
return [prefix, identifier, mappings[assetName], assetName].join('/'); | ||
return [prefix, identifier, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/'); | ||
}; | ||
@@ -133,0 +137,0 @@ exports.prefixAssetsPath = prefixAssetsPath; |
@@ -105,16 +105,20 @@ import { camelCaseToDashCase, removeIllegalCharacters, dashCaseToUpperCamelCase, } from './string-utils'; | ||
/* | ||
If the value from the mapping is an empty string | ||
we need to not join it in the return path as it would append | ||
a wrong / | ||
*/ | ||
if (!mappings[assetName]) { | ||
need to use either the original or decoded assetName to retrieve its mapping if there is one | ||
*/ | ||
var assetNameUsedForMapping = typeof mappings[assetName] === 'string' ? assetName : decodedAssetName; | ||
/* | ||
If the value from the mapping is an empty string | ||
we need to not join it in the return path as it would append | ||
a wrong / | ||
*/ | ||
if (!mappings[assetNameUsedForMapping]) { | ||
if (!identifier) { | ||
return [prefix, assetName].join('/'); | ||
return [prefix, assetNameUsedForMapping].join('/'); | ||
} | ||
return [prefix, identifier, assetName].join('/'); | ||
return [prefix, identifier, assetNameUsedForMapping].join('/'); | ||
} | ||
if (!identifier) { | ||
return [prefix, mappings[assetName], assetName].join('/'); | ||
return [prefix, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/'); | ||
} | ||
return [prefix, identifier, mappings[assetName], assetName].join('/'); | ||
return [prefix, identifier, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/'); | ||
}; | ||
@@ -121,0 +125,0 @@ // Clones existing objects while keeping the type cast |
{ | ||
"name": "@teleporthq/teleport-shared", | ||
"version": "0.27.0", | ||
"version": "0.27.1", | ||
"description": "A utility belt for the entire teleportHQ ecosystem", | ||
@@ -32,3 +32,3 @@ "author": "teleportHQ", | ||
}, | ||
"gitHead": "d11357eea374e782b24d2813eb36b6bee378f954" | ||
"gitHead": "82a3f3a6c78a35d716c1ce10bda5fce20a26b5c3" | ||
} |
@@ -156,18 +156,25 @@ import { | ||
/* | ||
If the value from the mapping is an empty string | ||
we need to not join it in the return path as it would append | ||
a wrong / | ||
*/ | ||
need to use either the original or decoded assetName to retrieve its mapping if there is one | ||
*/ | ||
if (!mappings[assetName]) { | ||
const assetNameUsedForMapping = | ||
typeof mappings[assetName] === 'string' ? assetName : decodedAssetName | ||
/* | ||
If the value from the mapping is an empty string | ||
we need to not join it in the return path as it would append | ||
a wrong / | ||
*/ | ||
if (!mappings[assetNameUsedForMapping]) { | ||
if (!identifier) { | ||
return [prefix, assetName].join('/') | ||
return [prefix, assetNameUsedForMapping].join('/') | ||
} | ||
return [prefix, identifier, assetName].join('/') | ||
return [prefix, identifier, assetNameUsedForMapping].join('/') | ||
} | ||
if (!identifier) { | ||
return [prefix, mappings[assetName], assetName].join('/') | ||
return [prefix, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/') | ||
} | ||
return [prefix, identifier, mappings[assetName], assetName].join('/') | ||
return [prefix, identifier, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/') | ||
} | ||
@@ -174,0 +181,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
180195
0.7%2519
0.52%