@nuxt/utils
Advanced tools
Comparing version 2.4.3 to 2.4.5
/*! | ||
* @nuxt/utils v2.4.3 (c) 2016-2019 | ||
* @nuxt/utils v2.4.5 (c) 2016-2019 | ||
@@ -1364,10 +1364,10 @@ * - All the amazing contributors | ||
*/ | ||
function baseGet(object, path$$1) { | ||
path$$1 = _castPath(path$$1, object); | ||
function baseGet(object, path) { | ||
path = _castPath(path, object); | ||
var index = 0, | ||
length = path$$1.length; | ||
length = path.length; | ||
while (object != null && index < length) { | ||
object = object[_toKey(path$$1[index++])]; | ||
object = object[_toKey(path[index++])]; | ||
} | ||
@@ -1404,4 +1404,4 @@ return (index && index == length) ? object : undefined; | ||
*/ | ||
function get(object, path$$1, defaultValue) { | ||
var result = object == null ? undefined : _baseGet(object, path$$1); | ||
function get(object, path, defaultValue) { | ||
var result = object == null ? undefined : _baseGet(object, path); | ||
return result === undefined ? defaultValue : result; | ||
@@ -1413,18 +1413,18 @@ } | ||
const flatRoutes = function flatRoutes(router, _path = '', routes = []) { | ||
router.forEach((r$$1) => { | ||
if ([':', '*'].some(c => r$$1.path.includes(c))) { | ||
router.forEach((r) => { | ||
if ([':', '*'].some(c => r.path.includes(c))) { | ||
return | ||
} | ||
/* istanbul ignore if */ | ||
if (r$$1.children) { | ||
if (_path === '' && r$$1.path === '/') { | ||
if (r.children) { | ||
if (_path === '' && r.path === '/') { | ||
routes.push('/'); | ||
} | ||
return flatRoutes(r$$1.children, _path + r$$1.path + '/', routes) | ||
return flatRoutes(r.children, _path + r.path + '/', routes) | ||
} | ||
_path = _path.replace(/^\/+$/, '/'); | ||
routes.push( | ||
(r$$1.path === '' && _path[_path.length - 1] === '/' | ||
(r.path === '' && _path[_path.length - 1] === '/' | ||
? _path.slice(0, -1) | ||
: _path) + r$$1.path | ||
: _path) + r.path | ||
); | ||
@@ -1456,4 +1456,4 @@ }); | ||
} // clean first / for parents | ||
routesIndex.forEach((r$$1) => { | ||
const i = r$$1.indexOf('index') - start; // children names | ||
routesIndex.forEach((r) => { | ||
const i = r.indexOf('index') - start; // children names | ||
if (i < paths.length) { | ||
@@ -1464,3 +1464,3 @@ for (let a = 0; a <= i; a++) { | ||
} | ||
if (a < i && names[a] !== r$$1[a]) { | ||
if (a < i && names[a] !== r[a]) { | ||
break | ||
@@ -1467,0 +1467,0 @@ } |
{ | ||
"name": "@nuxt/utils", | ||
"version": "2.4.3", | ||
"version": "2.4.5", | ||
"repository": "nuxt/nuxt.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1
46868