We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19c71fd commit d7b10f5Copy full SHA for d7b10f5
1 file changed
index.js
@@ -1,3 +1,7 @@
1
module.exports = function (res, val, i) {
2
+ if (typeof res !== 'string' && !Array.isArray(res))
3
+ throw new TypeError('First argument invalid. Expected Array or String.')
4
+ if (typeof i !== 'undefined' && typeof i !== 'number')
5
+ throw new TypeError('Third argument invalid. Expected Number.')
6
return res.slice(0, i || 0).concat(val).concat(res.slice(i || 0))
7
}
0 commit comments