@teleporthq/teleport-shared
Advanced tools
Comparing version
@@ -117,20 +117,20 @@ "use strict"; | ||
/* | ||
need to use either the original or decoded assetName to retrieve its mapping if there is one | ||
*/ | ||
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 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, assetNameUsedForMapping].join('/'); | ||
return [prefix, assetName].join('/'); | ||
} | ||
return [prefix, identifier, assetNameUsedForMapping].join('/'); | ||
return [prefix, identifier, assetName].join('/'); | ||
} | ||
if (!identifier) { | ||
return [prefix, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/'); | ||
return [prefix, mappings[assetNameUsedForMapping], assetName].join('/'); | ||
} | ||
return [prefix, identifier, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/'); | ||
return [prefix, identifier, mappings[assetNameUsedForMapping], assetName].join('/'); | ||
}; | ||
@@ -137,0 +137,0 @@ exports.prefixAssetsPath = prefixAssetsPath; |
@@ -105,20 +105,20 @@ import { camelCaseToDashCase, removeIllegalCharacters, dashCaseToUpperCamelCase, } from './string-utils'; | ||
/* | ||
need to use either the original or decoded assetName to retrieve its mapping if there is one | ||
*/ | ||
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 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, assetNameUsedForMapping].join('/'); | ||
return [prefix, assetName].join('/'); | ||
} | ||
return [prefix, identifier, assetNameUsedForMapping].join('/'); | ||
return [prefix, identifier, assetName].join('/'); | ||
} | ||
if (!identifier) { | ||
return [prefix, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/'); | ||
return [prefix, mappings[assetNameUsedForMapping], assetName].join('/'); | ||
} | ||
return [prefix, identifier, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/'); | ||
return [prefix, identifier, mappings[assetNameUsedForMapping], assetName].join('/'); | ||
}; | ||
@@ -125,0 +125,0 @@ // Clones existing objects while keeping the type cast |
{ | ||
"name": "@teleporthq/teleport-shared", | ||
"version": "0.27.1", | ||
"version": "0.27.2", | ||
"description": "A utility belt for the entire teleportHQ ecosystem", | ||
@@ -32,3 +32,3 @@ "author": "teleportHQ", | ||
}, | ||
"gitHead": "82a3f3a6c78a35d716c1ce10bda5fce20a26b5c3" | ||
"gitHead": "53c7b8a9ffbe8e18341da464580e08f5292c3f00" | ||
} |
@@ -156,4 +156,4 @@ import { | ||
/* | ||
need to use either the original or decoded assetName to retrieve its mapping if there is one | ||
*/ | ||
need to use either the original or decoded assetName to retrieve its mapping if there is one | ||
*/ | ||
@@ -164,18 +164,18 @@ const assetNameUsedForMapping = | ||
/* | ||
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 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, assetNameUsedForMapping].join('/') | ||
return [prefix, assetName].join('/') | ||
} | ||
return [prefix, identifier, assetNameUsedForMapping].join('/') | ||
return [prefix, identifier, assetName].join('/') | ||
} | ||
if (!identifier) { | ||
return [prefix, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/') | ||
return [prefix, mappings[assetNameUsedForMapping], assetName].join('/') | ||
} | ||
return [prefix, identifier, mappings[assetNameUsedForMapping], assetNameUsedForMapping].join('/') | ||
return [prefix, identifier, mappings[assetNameUsedForMapping], assetName].join('/') | ||
} | ||
@@ -182,0 +182,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
179975
-0.12%