Skip to content

Commit

Permalink
fix stricter type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
jj committed Aug 27, 2021
1 parent 6788963 commit 0ebcf4e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/ghost-normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const syntaxHighlightWithPrismJS = (htmlAst: Node) => {
className = (className || []).concat('language-' + lang)
result = refractor.highlight(nodeToString(node), lang)
} catch (err) {
if (prism.ignoreMissing && /Unknown language/.test(err.message)) {
if (prism.ignoreMissing && /Unknown language/.test((err as Error).message)) {
return
}
throw err
Expand Down
4 changes: 2 additions & 2 deletions lib/ghost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export async function getPostBySlug(slug: string): Promise<GhostPostOrPage | nul

const { url } = await getAllSettings()
result = await normalizePost(post, (url && urlParse(url)) || undefined)
} catch (error) {
} catch (error: any) {
if (error.response?.status !== 404) throw new Error(error)
return null
}
Expand All @@ -222,7 +222,7 @@ export async function getPageBySlug(slug: string): Promise<GhostPostOrPage | nul

const { url } = await getAllSettings()
result = await normalizePost(page, (url && urlParse(url)) || undefined)
} catch (error) {
} catch (error: any) {
if (error.response?.status !== 404) throw new Error(error)
return null
}
Expand Down
2 changes: 1 addition & 1 deletion lib/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const imageDimensions = async (url: string | undefined | null, noCache?:
width = w
height = h
hasError = false
} catch (error) {
} catch (error: any) {
const { code } = error

hasError = true
Expand Down

0 comments on commit 0ebcf4e

Please sign in to comment.