Skip to content

Commit

Permalink
chore: adjustment of isDebug
Browse files Browse the repository at this point in the history
  • Loading branch information
lgou2w committed Sep 3, 2021
1 parent 9b6cdb6 commit 8a44e09
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { createHmac } from 'crypto'
import got from 'got'

const debug = require('debug')('lgou2w:picacomic-api')
const isDebug = typeof process.env.DEBUG !== 'undefined'

export type Options = {
timeout?: number
Expand Down Expand Up @@ -89,7 +88,7 @@ export class PicaComicAPI {
if (options.context.fetchImage) return // skip image fetch
const url = options.url.toString()
const method = options.method
isDebug && debug('FETCH -> %s %s', method, url)
debug.enabled && debug('FETCH -> %s %s', method, url)
const {
api, apiKey, signatureKey,
channel, version, uuid, platform, buildVersion,
Expand Down

0 comments on commit 8a44e09

Please sign in to comment.