@nuxt/utils
Advanced tools
Comparing version 2.9.2 to 2.10.0
/*! | ||
* @nuxt/utils v2.9.2 (c) 2016-2019 | ||
* @nuxt/utils v2.10.0 (c) 2016-2019 | ||
@@ -1639,3 +1639,4 @@ * - All the amazing contributors | ||
routeNameSplitter = '-', | ||
supportedExtensions = ['vue', 'js'] | ||
supportedExtensions = ['vue', 'js'], | ||
trailingSlash | ||
}) { | ||
@@ -1677,2 +1678,7 @@ const routes = []; | ||
}); | ||
if (trailingSlash !== undefined) { | ||
route.pathToRegexpOptions = { ...route.pathToRegexpOptions, strict: true }; | ||
route.path = route.path.replace(/\/+$/, '') + (trailingSlash ? '/' : ''); | ||
} | ||
parent.push(route); | ||
@@ -1899,5 +1905,9 @@ }); | ||
function isExternalDependency (id) { | ||
return /[/\\]node_modules[/\\]/.test(id) | ||
} | ||
function clearRequireCache (id) { | ||
const entry = require.cache[id]; | ||
if (!entry || id.includes('node_modules')) { | ||
if (!entry || isExternalDependency(id)) { | ||
return | ||
@@ -1919,3 +1929,3 @@ } | ||
const entry = require.cache[id]; | ||
if (!entry || id.includes('node_modules') || files.has(id)) { | ||
if (!entry || isExternalDependency(id) || files.has(id)) { | ||
return files | ||
@@ -1933,2 +1943,13 @@ } | ||
function tryRequire (id) { | ||
try { | ||
return require(id) | ||
} catch (e) { | ||
} | ||
} | ||
function getPKG (id) { | ||
return tryRequire(id + '/package.json') | ||
} | ||
const ModernBrowsers = { | ||
@@ -1998,3 +2019,5 @@ Edge: '16', | ||
exports.getMainModule = getMainModule; | ||
exports.getPKG = getPKG; | ||
exports.guardDir = guardDir; | ||
exports.isExternalDependency = isExternalDependency; | ||
exports.isIndexFileAndFolder = isIndexFileAndFolder; | ||
@@ -2019,2 +2042,3 @@ exports.isModernBrowser = isModernBrowser; | ||
exports.serializeFunction = serializeFunction; | ||
exports.sortRoutes = sortRoutes; | ||
exports.startsWithAlias = startsWithAlias; | ||
@@ -2025,2 +2049,3 @@ exports.startsWithRootAlias = startsWithRootAlias; | ||
exports.timeout = timeout; | ||
exports.tryRequire = tryRequire; | ||
exports.urlJoin = urlJoin; | ||
@@ -2027,0 +2052,0 @@ exports.wChunk = wChunk; |
{ | ||
"name": "@nuxt/utils", | ||
"version": "2.9.2", | ||
"version": "2.10.0", | ||
"repository": "nuxt/nuxt.js", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"semver": "^6.3.0", | ||
"serialize-javascript": "^1.8.0", | ||
"serialize-javascript": "^2.1.0", | ||
"signal-exit": "^3.0.2", | ||
@@ -19,0 +19,0 @@ "ua-parser-js": "^0.7.20" |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
52783
1774
2
3
+ Addedserialize-javascript@2.1.2(transitive)
- Removedserialize-javascript@1.9.1(transitive)
Updatedserialize-javascript@^2.1.0