@tgxd/caps-allowed
v1.0.3
Published
Check if a String has the allowed Percentage of Caps
Downloads
6
Readme
caps-allowed
Installation
npm
npm install @tgxd/caps-allowed
git
git clone https://github.com/ToxicGamerXD/caps-allowed.git
Example Usage
Simple usage of the package
const caps_allowed = require("@tgxd/caps-allowed")
console.log(caps_allowed("This String hasn't to many Caps", 65))
/* -> Outcome:
{
string: "This String hasn't to many Caps",
minStringLength: 0,
stringLength: 31,
capsLength: 3,
capsPercentage: 4.6,
maxCapsPercentage: 65,
isMaxCaps: false
}
*/
Simple Example check if the String has to many Caps
const caps_allowed = require("@tgxd/caps-allowed")
let object = caps_allowed("This String hasn't to many Caps", 65)
// If the String has too many Caps, it says "Too many Caps in the String"
if(object.isMaxCaps) {
console.log("Too many Caps in the String")
}
// If the String hasn't too many Caps, it says "Not too many Caps in the String"
else {
console.log("Not too many Caps in the String")
}