Skip to content

Commit

Permalink
update(nomalizData): remove casting
Browse files Browse the repository at this point in the history
  • Loading branch information
dependentmadani committed Jul 4, 2024
1 parent 9cbae65 commit 66cfd91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ export default class Header {
const newData: HeaderData = { text: '', level: this.defaultLevel.number };

if (!this.isHeaderData(data)) {
data = { text: '', level: this.defaultLevel.number};
return { text: '', level: this.defaultLevel.number};
}

newData.text = (data as HeaderData).text || '';
newData.level = parseInt((data as HeaderData).level.toString()) || this.defaultLevel.number;
newData.text = data.text || '';
newData.level = parseInt(data.level.toString()) || this.defaultLevel.number;

return newData;
}
Expand Down

0 comments on commit 66cfd91

Please sign in to comment.