chore: upgrade deps (#91)

* chore: upgrade deps

* fix: lint errors
This commit is contained in:
Daniel Roe 2020-11-16 08:33:33 +00:00 committed by GitHub
parent ae32ca42fa
commit 99129216ee
8 changed files with 25 additions and 18 deletions

View File

@ -88,7 +88,7 @@ function advancedGet (obj = {}, query = '') {
const v = get(i, l)
if (!v) {
return
return false
}
if (
@ -99,6 +99,8 @@ function advancedGet (obj = {}, query = '') {
) {
return true
}
return false
})
if (result.length === 1) {

View File

@ -385,8 +385,11 @@ function normalizeConfig (_options: CliConfiguration) {
overrideProp(options.server, 'timing', { total: true, ...options.server.timing })
}
overrideProp(options, 'serverMiddleware', Array.isArray(options.serverMiddleware) ? options.serverMiddleware : Object.entries(options.serverMiddleware)
.map(([path, handler]) => ({ path, handler }))
overrideProp(options, 'serverMiddleware',
Array.isArray(options.serverMiddleware)
? options.serverMiddleware
: Object.entries(options.serverMiddleware)
.map(([path, handler]) => ({ path, handler }))
)
// Generate staticAssets

View File

@ -329,7 +329,7 @@ export default class Generator {
// If crawler activated and called from generateRoutes()
if (this.options.generate.crawler && this.options.render.ssr) {
const possibleTrailingSlash = this.options.router.trailingSlash ? '/' : ''
parse(html).querySelectorAll('a').map((el) => {
parse(html).querySelectorAll('a').forEach((el) => {
const sanitizedHref = (el.getAttribute('href') || '')
.replace(this.options.router.base, '/')
.replace(/\/+$/, '')

View File

@ -15,7 +15,7 @@ export default async function renderAndGetWindow (
loadedCallback,
loadingTimeout = 2000,
globals
}: Options
}: Partial<Options> = {}
) {
const jsdom = await import('jsdom')
.then(m => m.default || m)

View File

@ -117,17 +117,21 @@ export const sortRoutes = function sortRoutes (routes: NuxtRouteConfig[]) {
// If a.length >= b.length
if (i === _b.length - 1 && res === 0) {
// unless * found sort by level, then alphabetically
res = _a[i] === '*' ? -1 : (
_a.length === _b.length ? a.path.localeCompare(b.path) : (_a.length - _b.length)
)
res = _a[i] === '*'
? -1
: (
_a.length === _b.length ? a.path.localeCompare(b.path) : (_a.length - _b.length)
)
}
}
if (res === 0) {
// unless * found sort by level, then alphabetically
res = _a[i - 1] === '*' && _b[i] ? 1 : (
_a.length === _b.length ? a.path.localeCompare(b.path) : (_a.length - _b.length)
)
res = _a[i - 1] === '*' && _b[i]
? 1
: (
_a.length === _b.length ? a.path.localeCompare(b.path) : (_a.length - _b.length)
)
}
return res
})

View File

@ -5,7 +5,7 @@ function contains (arr, val) {
return arr && arr.includes(val)
}
const atPrefix = new RegExp('^@', 'g')
const atPrefix = /^@/g
function readDir (dirName) {
if (!fs.existsSync(dirName)) {
@ -95,10 +95,7 @@ function containsPattern (arr, val) {
)
}
const scopedModuleRegex = new RegExp(
'@[a-zA-Z0-9][\\w-.]+/[a-zA-Z0-9][\\w-.]+([a-zA-Z0-9./]+)?',
'g'
)
const scopedModuleRegex = /@[a-zA-Z0-9][\\w-.]+\/[a-zA-Z0-9][\\w-.]+([a-zA-Z0-9./]+)?/g
function getModuleName (request, includeAbsolutePaths) {
let req = request

View File

@ -192,7 +192,8 @@ function getOutput (ctx: WebpackConfigContext): Configuration['output'] {
path: resolve(options.buildDir, 'dist', ctx.isServer ? 'server' : 'client'),
filename: fileName(ctx, 'app'),
chunkFilename: fileName(ctx, 'chunk'),
publicPath: isUrl(options.build.publicPath) ? options.build.publicPath
publicPath: isUrl(options.build.publicPath)
? options.build.publicPath
: urlJoin(options.router.base, options.build.publicPath)
}
}

View File

@ -153,7 +153,7 @@ export default class PostcssConfig {
const plugin = this.nuxt.resolver.requireModule(p)
const opts = plugins[p]
if (opts === false) {
return // Disabled
return false // Disabled
}
return plugin(opts)
})