UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

21 lines (20 loc) 629 B
var getParamName = function (pattern) { return pattern.replace(/^[:*]/, "").replace(/\?$/, ""); }; function getParamValue(p, value) { if (p.startsWith("*")) { var values = value.split("/").filter(function (v) { return v !== ""; }); return values.length === 0 && p.endsWith("?") ? void 0 : values; } return value; } function isDynamicPart(p) { return p.length > 1 && (p.startsWith(":") || p.startsWith("*")); } function replacePart(p) { return p.replace(/^[:*]/, "").replace(/\?$/, ""); } export { getParamName, getParamValue, isDynamicPart, replacePart }; //# sourceMappingURL=_shared.native.js.map