Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const consola = require('consola').withTag('MongoDB')
// Utiliy function to setup logger on db
function logConnectionEvents (conn) {
// Emitted after getting disconnected from the db.
// _readyState: 0
conn.on('disconnected', () => {
conn.$logger.debug('Disconnected!')
})
// Emitted when this connection successfully connects to the db.
// May be emitted multiple times in reconnected scenarios.
// _readyState: 1
conn.on('connected', () => {
conn.$logger.success('Connected!')
})
const { resolve } = require('path')
const consola = require('consola')
const logger = consola.withTag('nuxt-adsense-module')
// Default for adslots (defaults to test mode)
const DEFAULTS = {
tag: 'adsbygoogle',
id: null,
pageLevelAds: false,
includeQuery: false,
analyticsUacct: '',
analyticsDomainName: '',
test: false,
shouldRandomizeAdRegion: false
}
// Default client ID for testing
const TEST_ID = 'ca-google'
// Adsense script URL
import consola from 'consola'
import BundleBuddyWebpackPlugin from 'bundle-buddy-webpack-plugin'
const logger = consola.withTag('nuxt-bundle-buddy')
export default function nuxtBundleBuddy() {
const { build: { analyze }, dev, bundleBuddy } = this.options
const options = Object.assign({}, { removeDefaultAnalyzer: true }, bundleBuddy)
if (!dev && analyze) {
logger.info('Loading module')
this.extendBuild(webpackFn(options))
}
}
const webpackFn = options => (config, { isServer, isModern }) => {
// Only evaluate client bundle
if (isServer || isModern) {
return
_init () {
// Try to read package.json
this.readPkg()
// Use tagged logger
this.logger = consola.withTag(this.pkg.name)
// Try to load config
this.loadConfig()
}
if (!argRegex.test(arg)) {
throw badRequest('Invalid argument: ' + arg)
}
return arg
}
export const VMax = max => num => {
if (!numRegex.test(num)) {
throw badRequest('Invalid numeric argument: ' + num)
}
return Math.min(parseInt(num), max) || null
}
export const VSize = VMax(MAX_SIZE)
export const consola = Consola.withTag('ipx')