UNPKG

one

Version:

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

40 lines (39 loc) 922 B
function removeParams(state, paramNames) { if (!state?.routes) return state; return { ...state, routes: state.routes.map(route => { let newRoute = route; if (route.params) { const filtered = { ...route.params }; let changed = false; for (const name of paramNames) { if (name in filtered) { delete filtered[name]; changed = true; } } if (changed) { newRoute = { ...newRoute, params: filtered }; } } if (route.state) { const newState = removeParams(route.state, paramNames); if (newState !== route.state) { newRoute = { ...newRoute, state: newState }; } } return newRoute; }) }; } export { removeParams }; //# sourceMappingURL=removeParams.mjs.map