mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
fix: throw error instead of returning it (#1624)
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
const CheckKebabCase = (varName) => {
|
||||
// firstly, check that input is a string or not.
|
||||
if (typeof varName !== 'string') {
|
||||
return new TypeError('Argument is not a string.')
|
||||
throw new TypeError('Argument is not a string.')
|
||||
}
|
||||
|
||||
const pat = /(\w+)-(\w)([\w-]*)/
|
||||
|
Reference in New Issue
Block a user