From 0ec580475872d700b7ba650b0093cb531c0a425f Mon Sep 17 00:00:00 2001 From: morning Date: Fri, 13 Nov 2020 15:14:15 +0800 Subject: [PATCH] feat: avoid install installed plugin --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index 439a392f9..6bf5ee656 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 }