Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
vue-flatten-routes
Advanced tools
Get a flat routes array from your [`vue-router`](https://github.com/vuejs/vue-router) compatible routes. ## Install ``` npm install --save vue-flatten-routes ``` ## Usage ```js // Helpers import { flattenRoutes } from 'vue-flatten-routes'
Get a flat routes array from your vue-router
compatible routes.
npm install --save vue-flatten-routes
// Helpers
import { flattenRoutes } from 'vue-flatten-routes'
// Routes
const routes = [
{
name: 'foo',
path: 'foo',
children: [
{
name: 'foo-first-level-child',
path: 'foo-first-level-child',
children: [
{
path: 'foo-second-level-child',
name: 'foo-second-level-child',
children: [
{
path: 'foo-third-level-child',
name: 'foo-third-level-child'
}
]
}
]
},
{
name: 'foo-first-level-child-nd',
path: 'foo-first-level-child-nd',
}
]
},
{
name: 'bar',
path: 'bar'
}
]
// Flatten
console.log(JSON.stringify(flattenRoutes(routes), null, 2))
/* Output:
[
{
"name": "foo",
"path": "foo",
"level": 0
},
{
"name": "foo-first-level-child",
"path": "foo-first-level-child",
"level": 1
},
{
"name": "foo-second-level-child",
"path": "foo-second-level-child",
"level": 2
},
{
"name": "foo-third-level-child",
"path": "foo-third-level-child",
"level": 3
},
{
"name": "foo-first-level-child-nd",
"path": "foo-first-level-child-nd",
"level": 1
},
{
"name": "bar",
"path": "bar",
"level": 0
}
]
*/
FAQs
Get a flat routes array from your [`vue-router`](https://github.com/vuejs/vue-router) compatible routes. ## Install ``` npm install --save vue-flatten-routes ``` ## Usage ```js import { flattenRoutes } from 'vue-flatten-routes'
The npm package vue-flatten-routes receives a total of 8 weekly downloads. As such, vue-flatten-routes popularity was classified as not popular.
We found that vue-flatten-routes 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.