From a92eb6c4dc1437ec920e69484d52984f5921a8ea Mon Sep 17 00:00:00 2001 From: morning Date: Mon, 23 Nov 2020 17:00:32 +0800 Subject: [PATCH] fix: avoid install installed plugin (#1214) --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index 439a392f..6bf5ee65 100644 --- a/src/index.js +++ b/src/index.js @@ -387,7 +387,12 @@ dayjs.prototype = proto; }) dayjs.extend = (plugin, option) => { + if (plugin.installed) { + return dayjs + } + plugin(option, Dayjs, dayjs) + plugin.installed = true return dayjs }