UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

22 lines (20 loc) • 627 B
var getParamName = function getParamName2(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