Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nuxt/utils

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxt/utils - npm Package Compare versions

Comparing version 2.14.0 to 2.14.1

21

dist/utils.js
/*!
* @nuxt/utils v2.14.0 (c) 2016-2020
* @nuxt/utils v2.14.1 (c) 2016-2020

@@ -1558,12 +1558,9 @@ * - All the amazing contributors

function cleanChildrenRoutes (routes, isChild = false, routeNameSplitter = '-', trailingSlash) {
let start = -1;
function cleanChildrenRoutes (routes, isChild = false, routeNameSplitter = '-', trailingSlash, parentRouteName) {
const regExpIndex = new RegExp(`${routeNameSplitter}index$`);
const regExpParentRouteName = new RegExp(`^${parentRouteName}${routeNameSplitter}`);
const routesIndex = [];
routes.forEach((route) => {
if (regExpIndex.test(route.name) || route.name === 'index') {
// Save indexOf 'index' key in name
const res = route.name.split(routeNameSplitter);
const s = res.indexOf('index');
start = start === -1 || s < start ? s : start;
const res = route.name.replace(regExpParentRouteName, '').split(routeNameSplitter);
routesIndex.push(res);

@@ -1575,3 +1572,6 @@ }

if (route.path.includes('?')) {
const names = route.name.split(routeNameSplitter);
if (route.name.endsWith(`${routeNameSplitter}index`)) {
route.path = route.path.replace(/\?$/, '');
}
const names = route.name.replace(regExpParentRouteName, '').split(routeNameSplitter);
const paths = route.path.split('/');

@@ -1582,3 +1582,3 @@ if (!isChild) {

routesIndex.forEach((r) => {
const i = r.indexOf('index') - start; // children names
const i = r.indexOf('index');
if (i < paths.length) {

@@ -1601,2 +1601,3 @@ for (let a = 0; a <= i; a++) {

const defaultChildRoute = route.children.find(child => child.path === indexRoutePath);
const routeName = route.name;
if (defaultChildRoute) {

@@ -1608,3 +1609,3 @@ if (trailingSlash === false) {

}
route.children = cleanChildrenRoutes(route.children, true, routeNameSplitter, trailingSlash);
route.children = cleanChildrenRoutes(route.children, true, routeNameSplitter, trailingSlash, routeName);
}

@@ -1611,0 +1612,0 @@ });

{
"name": "@nuxt/utils",
"version": "2.14.0",
"version": "2.14.1",
"repository": "nuxt/nuxt.js",

@@ -5,0 +5,0 @@ "license": "MIT",

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