Skip to content

Commit

Permalink
Merge pull request #37 from observerly/refactor/header/parseFITSHeade…
Browse files Browse the repository at this point in the history
…rRow

refactor: amend parseFITSHeaderRow in header module in @observerly/fits
  • Loading branch information
michealroberts authored Jan 5, 2025
2 parents 3ba1cef + 9029974 commit 45b241f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/header/parseFITSHeaderRow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ export const parseFITSHeaderRow = (line: string): FITSHeader => {
value = v.slice(1, -1).trim()
}

if (!isNaN(parseFloat(v))) {
value = parseFloat(v)
if (!Number.isNaN(Number.parseFloat(v))) {
value = Number.parseFloat(v)
}

if (v.length === 1 && ['T', 'F'].includes(v)) {
value = v === 'T' ? true : false
value = v === 'T'
}

const comment = c ? c.trim() : ''
Expand All @@ -68,4 +68,4 @@ export const parseFITSHeaderRow = (line: string): FITSHeader => {
}
}

/*****************************************************************************************************************/
/*****************************************************************************************************************/

0 comments on commit 45b241f

Please sign in to comment.