stricter type checking
This commit is contained in:
parent
c4e0e85c51
commit
978652bc0a
1 changed files with 9 additions and 1 deletions
|
|
@ -1269,7 +1269,15 @@ const createPost = async (tags, title, content) => {
|
||||||
v => typeof v !== 'number'
|
v => typeof v !== 'number'
|
||||||
)
|
)
|
||||||
|
|
||||||
return typeof maybeNumOfPages === 'number' ? maybeNumOfPages : 0
|
if (typeof maybeNumOfPages !== 'number') {
|
||||||
|
throw new TypeError(
|
||||||
|
`Could not fetch number of pages from wall, instead got: ${JSON.stringify(
|
||||||
|
maybeNumOfPages
|
||||||
|
)}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return maybeNumOfPages
|
||||||
})()
|
})()
|
||||||
|
|
||||||
let pageIdx = Math.max(0, numOfPages - 1).toString()
|
let pageIdx = Math.max(0, numOfPages - 1).toString()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue