fix: throw error instead of returning it (#1624)

This commit is contained in:
Piotr Idzik
2024-02-29 05:55:11 +01:00
committed by GitHub
parent c067a34fae
commit a5945e37c2
7 changed files with 19 additions and 3 deletions

View File

@ -10,7 +10,7 @@
const CheckPascalCase = (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 = /^[A-Z][A-Za-z]*$/