Commit b96bf7cf authored by wildfirecode13's avatar wildfirecode13

1

parent 1581a7ac
...@@ -7,7 +7,6 @@ const runTypeDoc = () => gulp ...@@ -7,7 +7,6 @@ const runTypeDoc = () => gulp
.pipe(typedoc({ .pipe(typedoc({
out: './docs', out: './docs',
mode:'file', mode:'file',
// 这个文件里都是 export * from '...' 就没必要导出文档了
exclude: '**/*/index.ts', exclude: '**/*/index.ts',
tsconfig: 'tsconfig.json', tsconfig: 'tsconfig.json',
})) }))
...@@ -31,4 +30,5 @@ const watch = () => gulp.watch( ...@@ -31,4 +30,5 @@ const watch = () => gulp.watch(
gulp.series(runTypeDoc, reload) gulp.series(runTypeDoc, reload)
) )
gulp.task('default', gulp.series(runTypeDoc, runBrowserSync, watch)) gulp.task('watch', gulp.series(runTypeDoc, runBrowserSync, watch))
\ No newline at end of file gulp.task('build', gulp.series(runTypeDoc))
\ No newline at end of file
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"buildDoc": "jsdoc", "doc": "gulp build",
"watchDoc": "gulp", "watch": "gulp watch",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"repository": { "repository": {
......
import { EventEmitter } from "../event"; import { EventEmitter } from "../event";
function getNum(n: any) { function getTimeNum(n: any) {
return n >= 10 ? `${n}` : `0${n}`; return n >= 10 ? `${n}` : `0${n}`;
} }
...@@ -31,14 +31,14 @@ export class Countdown extends EventEmitter<any> { ...@@ -31,14 +31,14 @@ export class Countdown extends EventEmitter<any> {
const hours = Math.floor(left / 3600); const hours = Math.floor(left / 3600);
const minutes = Math.floor((left % 3600) / 60); const minutes = Math.floor((left % 3600) / 60);
const seconds = left - hours * 3600 - minutes * 60; const seconds = left - hours * 3600 - minutes * 60;
return `${getNum(hours)}:${getNum(minutes)}:${getNum(seconds)}`; return `${getTimeNum(hours)}:${getTimeNum(minutes)}:${getTimeNum(seconds)}`;
} }
private getMMSS() { private getMMSS() {
const left = this._seconds - this._counter; const left = this._seconds - this._counter;
const minutes = Math.floor(left / 60); const minutes = Math.floor(left / 60);
const seconds = left % 60; const seconds = left % 60;
return `${getNum(minutes)}:${getNum(seconds)}`; return `${getTimeNum(minutes)}:${getTimeNum(seconds)}`;
} }
private getText() { private getText() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment