fary-client-log
Advanced tools
Comparing version 1.0.1 to 1.0.2
export { default as vueLogger } from './vue-logger'; | ||
import { ILog } from './types'; | ||
/** | ||
@@ -7,2 +8,2 @@ * 创建日志打印器 | ||
*/ | ||
export default function (namespace: any): {}; | ||
export default function (namespace: any): ILog; |
@@ -1,5 +0,5 @@ | ||
declare const process: { | ||
env: { | ||
NODE_ENV: string; | ||
}; | ||
}; | ||
export interface ILog { | ||
log?: (...args: any[]) => void; | ||
warn?: (...args: any[]) => void; | ||
error?: (...args: any[]) => void; | ||
} |
@@ -0,1 +1,2 @@ | ||
import './decleare.types'; | ||
import './types'; | ||
@@ -2,0 +3,0 @@ /** |
{ | ||
"name": "fary-client-log", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A friendly logger for client/browser, attached with vue logger.", | ||
"scripts": { | ||
"test": "karma start", | ||
"build": "rollup -c", | ||
@@ -27,10 +28,23 @@ "prepub": "npm run build", | ||
"devDependencies": { | ||
"@types/mocha": "^2.2.44", | ||
"karma": "^1.7.1", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-commonjs": "^1.0.0", | ||
"karma-mocha": "^1.3.0", | ||
"karma-phantomjs-launcher": "^1.0.4", | ||
"karma-safari-launcher": "^1.0.0", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^2.0.6", | ||
"mocha": "^4.0.1", | ||
"np": "^2.16.0", | ||
"rollup": "^0.52.0", | ||
"rollup-plugin-typescript2": "^0.8.4", | ||
"ts-loader": "^3.2.0", | ||
"tslint": "^5.7.0", | ||
"typescript": "^2.5.3", | ||
"vue": "^2.5.9" | ||
"typescript": "^2.6.2", | ||
"un": "0.0.0", | ||
"vue": "^2.5.9", | ||
"webpack": "^3.10.0" | ||
}, | ||
"dependencies": {} | ||
} |
import { logMap, shouldEnable } from './utils' | ||
export { default as vueLogger } from './vue-logger' | ||
import { ILog } from './types' | ||
@@ -9,4 +10,4 @@ /** | ||
*/ | ||
export default function(namespace) { | ||
const logger = {} | ||
export default function(namespace): ILog { | ||
const logger: ILog = {} | ||
// 如果不开启log, 则赋值为空函数 | ||
@@ -13,0 +14,0 @@ if (!shouldEnable(namespace)) { |
@@ -1,5 +0,5 @@ | ||
declare const process: { | ||
env: { | ||
NODE_ENV: string; | ||
}, | ||
export interface ILog { | ||
log?: (...args: any[]) => void, | ||
warn?: (...args: any[]) => void, | ||
error?: (...args: any[]) => void, | ||
} |
@@ -0,2 +1,4 @@ | ||
import './decleare.types' | ||
import './types' | ||
const IS_DEBUG = process.env.NODE_ENV === 'development' | ||
@@ -3,0 +5,0 @@ |
26537
19
675
19