Skip to content

Commit

Permalink
fix: 更新duration解析日志输出
Browse files Browse the repository at this point in the history
  • Loading branch information
sadais-lwt committed Mar 10, 2021
1 parent 4386b57 commit 08dbeb2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export function parseDuration(duration, defaultDuration = 300) {
let unit = (results[3] || 'ms').trim()
if (!/^m?s$/.test(unit)) {
// 如果单位不是ms 或者 s 则默认ms
console.error('duration: 单位错误', duration)
unit = 'ms'
}
if (unit === 'ms') {
Expand All @@ -122,6 +123,7 @@ export function parseDuration(duration, defaultDuration = 300) {
// 如果属性duration 是非法值 则使用默认值
cssDuration = `${defaultDuration / 1000}s`
jsDuration = defaultDuration
console.error('duration: 非法', duration)
}
} else {
// 属性duration为数字 则单位默认ms
Expand Down

0 comments on commit 08dbeb2

Please sign in to comment.