Skip to content

Commit

Permalink
Move logger.js to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Apr 16, 2024
1 parent f04835f commit 12effd8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/browser/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseUpload from '../upload.js'
import NoopUrlStorage from '../noopUrlStorage.js'
import { enableDebugLog } from '../logger.js'
import { enableDebugLog } from '../logger'
import DetailedError from '../error.js'

import { canStoreURLs, WebStorageUrlStorage } from './urlStorage.js'
Expand Down
4 changes: 2 additions & 2 deletions lib/logger.js → lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

let isEnabled = false

export function enableDebugLog() {
export function enableDebugLog(): void {
isEnabled = true
}

export function log(msg) {
export function log(msg: string): void {
if (!isEnabled) return
console.log(msg)
}
2 changes: 1 addition & 1 deletion lib/node/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseUpload from '../upload.js'
import NoopUrlStorage from '../noopUrlStorage.js'
import { enableDebugLog } from '../logger.js'
import { enableDebugLog } from '../logger'
import DetailedError from '../error.js'

import { FileUrlStorage, canStoreURLs } from './urlStorage.js'
Expand Down
2 changes: 1 addition & 1 deletion lib/upload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Base64 } from 'js-base64'
import URL from 'url-parse'
import DetailedError from './error.js'
import { log } from './logger.js'
import { log } from './logger'
import uuid from './uuid'

const PROTOCOL_TUS_V1 = 'tus-v1'
Expand Down

0 comments on commit 12effd8

Please sign in to comment.