UNPKG

@novin-dev/formalite

Version:

Generate MUI form with few line of code

23 lines (20 loc) 867 B
import 'react'; var getNameFromUrl = function (url) { return (url === null || url === void 0 ? void 0 : url.split(/[#?]/)[0].trim().split("/").pop()) || ""; }; var removeUrlExtras = function (url) { return (url === null || url === void 0 ? void 0 : url.split(/[#?]/)[0].trim()) || ""; }; var getExtensionFromUrl = function (file) { var _a, _b; if (file.original === "selected") { return file.name.split(".")[1]; } var lastPart = ((_a = removeUrlExtras(file.preview)) === null || _a === void 0 ? void 0 : _a.split("/")[(((_b = file.preview) === null || _b === void 0 ? void 0 : _b.split("/").length) || 1) - 1]) || ""; if (lastPart.includes(".")) { return lastPart.split(".")[1]; } return "jpg"; }; export { getExtensionFromUrl, getNameFromUrl, removeUrlExtras }; //# sourceMappingURL=utils.js.map