Skip to content

Commit

Permalink
Improve typeof invocation when parsing (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
stockiNail authored Jul 26, 2022
1 parent 9535327 commit 84c3d1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ _adapters._date.override({
parse: function(value, format) {
const options = this.options;

if (value === null || typeof value === 'undefined') {
const type = typeof value;
if (value === null || type === 'undefined') {
return null;
}

const type = typeof value;
if (type === 'number') {
value = this._create(value);
} else if (type === 'string') {
Expand Down

0 comments on commit 84c3d1b

Please sign in to comment.