Skip to content

Commit

Permalink
fix: objectSupport plugin causes an error when null is passed to dayj…
Browse files Browse the repository at this point in the history
…s function (closes iamkun#2277) (iamkun#2342)
  • Loading branch information
titanism authored and ohsory1324 committed Dec 20, 2023
1 parent 99cb196 commit 4ab1da4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin/objectSupport/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default (o, c, dayjs) => {
const proto = c.prototype
const isObject = obj => !(obj instanceof Date) && !(obj instanceof Array)
&& !proto.$utils().u(obj) && (obj.constructor.name === 'Object')
&& !proto.$utils().u(obj) && obj !== null && (obj.constructor.name === 'Object')
const prettyUnit = (u) => {
const unit = proto.$utils().p(u)
return unit === 'date' ? 'day' : unit
Expand Down

0 comments on commit 4ab1da4

Please sign in to comment.