Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1x 5x 5x 5x 4x 3x 2x 1x | import {getMessageErrorInRange, getMessageErrorNumber, getMessageErrorPositive} from './helpers.js' const isValidShowPages = (props, propName, componentName) => { const showPages = props[propName] const {totalPages} = props if (showPages === undefined) return null if (typeof showPages !== 'number') return new Error(getMessageErrorNumber({propName, componentName})) if (showPages <= 0) return new Error(getMessageErrorPositive({propName, componentName})) if (showPages > totalPages) return new Error(getMessageErrorInRange({propName, componentName})) // assume all ok return null } export default isValidShowPages |