
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@ajces/router
Advanced tools
This is forked from hyperapp/router and extracts the match logic into a framework agnostic Matcher. Additional handling of meta tag diffing on route changes, has also been added, using array of route objects [{path, view, meta}] instead of an array of arrays which I feel is clearer in the code.
The defaultMeta provided to the Router will allow defaults for routes that choose not to specify a meta value, anything supplied to a route meta object will be merged with defaultMeta via Object.assign({}, defaultMeta, match.meta)
There are meta tags that cause bugs in certain browsers if modified after page load, these are skipped in our meta diff to avoid issues: origin, referrer, viewport. ( any other key value pair should work in the meta object )
import { h, app } from "hyperapp";
import { router, updateMeta, Link, Router, Route } from "@ajces/router";
import { Header, Nav, Footer, About, Profile, Nested, NestedRoutes } from "./components";
const r = router(); // initializes the route state/actions/hook
app({
state: {
count: 0,
router: r.state
},
actions: {
router: r.actions
},
view: (state, actions) => (
<div>
<Header />
<Nav />
<Router
meta={
title: "Hyperapp Meta Router!",
description: "hyperapp componad based routing experiment",
keywords: "hyperapp, routing, router, meta",
author: "Andy Johnson"
}
pathname={state.router.path}
updateMeta={updateMeta}
>
<Route path="/" meta={params => ({ title: "Home" })} component={props => (
<div>
<h1>
{"HOME!"}
</h1>
<Link to="/about" go={actions.router.go} />
<Link to="/profile/andy" go={actions.router.go} />
</div>
)} />
<Route path="/about" onroute={match => console.log(match)} component={About} />
<Route path="/profile/:user" meta={params => ({ title: `Profile - ${params.user}` })} component={Profile} />
<Route path="/nested" component={Nested}>
<Route path="/routes" onroute={match => console.log("matched path /nested/routes")} component={NestedRoutes}>
</Route>
</Router>
<Footer />
</div>
),
hooks: [r.hook]
}));
@ajces/router is MIT licensed. See LICENSE.
FAQs
Utilities for routing client-side pages.
We found that @ajces/router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.