ice.fo.utils
Version:
18 lines (15 loc) • 467 B
JavaScript
/**
* http://localhost:8080/productImage/file/202110/06/e84739fa-757e-4f93-a0e1-2e2780cbe5db.png/09.sample_thum01.png
* ->
* http://localhost:8080/productImage/file/202110/06/e84739fa-757e-4f93-a0e1-2e2780cbe5db.png
*/
export default function getFilePathFromStorePath(value) {
if (!value) {
return value;
}
const checkUrl = value.substr(0, value.lastIndexOf('/'));
if (/\.[0-9a-z]{3,4}$/.test(checkUrl)) {
return checkUrl;
}
return value;
}