Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

regexbuddy

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regexbuddy - npm Package Compare versions

Comparing version 0.4.30 to 0.5.30

2

package.json
{
"name": "regexbuddy",
"version": "0.4.30",
"version": "0.5.30",
"description": "Implement regex expressions in JavaScript",

@@ -5,0 +5,0 @@ "repository": {

@@ -45,9 +45,9 @@ # RegexBuddy

Default requirements are that a password must contain:
Default requirements are that a password must contain (with the option name and data type for overwriting defaults):
1. At least one uppercase letter
2. At least one lowercase letter
3. At least one number
4. At least one special character
5. A minimum of 5 characters
1. At least one uppercase letter (name: requireUpperCase, type: boolean)
2. At least one lowercase letter (name: requireLowerCase, type: boolean)
3. At least one number (name: requireNumber, type: boolean)
4. At least one special character (name: requireSpecialCharacter, type: boolean)
5. A minimum of 5 characters (name: minLength, type: number)

@@ -57,5 +57,27 @@ The default requirements can be overwritten by passing in your requirements in the validate function like this:

```javascript
regexBuddy.password(input).validate({ minlength: 8, requireNumber: false });
regexBuddy.password(input).validate({ minlength: 8, requireSpecialCharacter: false });
```
**NOTE:** Options that are ignored will still have their default values used. So in the example above, a password must have at least 8 characters and does not need to have a number. But it must also still include an uppercase letter, lowercase letter, and a special character.
**NOTE:** Options that are ignored will still have their default values used. So in the example above, a password must have at least 8 characters and does not need to have a number. But it must also still include an uppercase letter, lowercase letter, and a special character.
An example of how to use this in your code would be:
```javascript
const validPassword = regexBuddy.password(input).validate({ minlength: 8, requireSpecialCharacter: false });
```
This would let you reference the `validPassword` variable in a simple way, like this conditional statement:
```javascript
// If a password is valid
if (validPassword) {
// Run this code
...
}
```
Or implement in your corresponding template file, like this:
```html
<button type="submit" disabled={!validPassword}>Submit</button>
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc