fix lint errors

master
Pooya Parsa 2019-09-05 18:34:41 +02:00
parent 0047e6fd76
commit fcc7934610
4 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@ const semver = require('semver')
const logger = consola.withScope('nuxt:http')
function httpModule(_moduleOptions) {
function httpModule (_moduleOptions) {
// Combine options
const moduleOptions = { ...this.options.http, ..._moduleOptions }
@ -72,7 +72,7 @@ function httpModule(_moduleOptions) {
// Convert http:// to https:// if https option is on
if (options.https === true) {
const https = s => s.indexOf('//localhost:') > -1 ? s : s.replace('http://', 'https://')
const https = s => s.includes('//localhost:') ? s : s.replace('http://', 'https://')
options.baseURL = https(options.baseURL)
options.browserBaseURL = https(options.browserBaseURL)
}

View File

@ -4,7 +4,7 @@ const defaultConfig = require('./fixture/nuxt.config')
jest.setTimeout(60000)
async function setupMockNuxt(config) {
async function setupMockNuxt (config) {
const nuxt = new Nuxt({
...defaultConfig,
...config,
@ -24,7 +24,7 @@ async function setupMockNuxt(config) {
return nuxt
}
async function setupNuxt(config) {
async function setupNuxt (config) {
const nuxt = new Nuxt({
...defaultConfig,
...config,

View File

@ -1,6 +1,6 @@
module.exports = {
path: '/test_api',
handler(req, res) {
handler (req, res) {
res.end(JSON.stringify({
url: req.url,
method: req.method

View File

@ -1,6 +1,6 @@
export default {
actions: {
nuxtServerInit({ commit }, ctx) {
nuxtServerInit ({ commit }, ctx) {
if (!ctx.$http) {
throw new Error('$http is not defined!')
}