perf: refine code

This commit is contained in:
花裤衩
2020-05-05 13:20:03 +08:00
parent 95ee04326a
commit 7f13958bdf
2 changed files with 6 additions and 1 deletions

View File

@@ -9,7 +9,7 @@
* @returns {string | null}
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0 && time != null) {
if (arguments.length === 0 || !time) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'