Update String/CheckPascalCase.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
This commit is contained in:
SURYAPRATAP SINGH SURYAVANSHI
2021-08-20 13:17:59 +05:30
committed by GitHub
parent 8722d52980
commit cddfc342b7

View File

@ -10,7 +10,7 @@
const CheckPascalCase = (VarName) => { const CheckPascalCase = (VarName) => {
// firstly, check that input is a string or not. // firstly, check that input is a string or not.
if (typeof VarName !== 'string') { if (typeof VarName !== 'string') {
return 'Not string(s)' return new TypeError("Argument is not a string.")
} }
const pat = /^[A-Z][A-Za-z]*$/ const pat = /^[A-Z][A-Za-z]*$/