2 var isFinite = require('is-finite');
4 module.exports = function (str, n) {
5 if (typeof str !== 'string') {
6 throw new TypeError('Expected `input` to be a string');
9 if (n < 0 || !isFinite(n)) {
10 throw new TypeError('Expected `count` to be a positive finite number');