New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-export-routes-module

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-export-routes-module - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

20

lib/index.js

@@ -7,10 +7,6 @@ import { extractComponentOption } from './utils';

const nuxtInstance = this;
const jsonRoutesPath = !nuxtInstance.options.dev
? path.resolve(nuxtInstance.options.buildDir, path.join('dist', 'exported-routes.json'))
: null;
const jsonRoutesPath = path.resolve(nuxtInstance.options.buildDir, path.join('dist', 'exported-routes.json'));
let routes = [];
nuxtInstance.extendRoutes((routes) => {
routes = routes.map((route) => {
const savedRoutes = routes.map((route) => {
const options = extractComponentOption(route.component, 'routeOptions');

@@ -24,5 +20,3 @@

if (!nuxtInstance.options.dev) {
fs.outputJsonSync(jsonRoutesPath, routes);
}
fs.outputJsonSync(jsonRoutesPath, savedRoutes);
});

@@ -36,8 +30,4 @@

if (nuxtInstance.options.dev) {
res.end(JSON.stringify(routes));
} else {
const savedRoutes = fs.readJsonSync(jsonRoutesPath, { throws: false });
res.end(JSON.stringify(savedRoutes));
}
const savedRoutes = fs.readJsonSync(jsonRoutesPath, { throws: false });
res.end(JSON.stringify(savedRoutes));
} catch (err) {

@@ -44,0 +34,0 @@ next(err);

{
"name": "nuxt-export-routes-module",
"version": "1.0.0",
"version": "1.0.1",
"description": "Export routes module for Nuxt.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc