Skip to content

Commit

Permalink
feat: avoid install installed plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ibufu authored Nov 13, 2020
1 parent ef1979c commit 0ec5804
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 0ec5804

Please sign in to comment.