
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
js-laravel-validation
Advanced tools
All rules are base on documentation from https://laravel.com/docs/5.7/validation#available-validation-rules
Install: npm install js-laravel-validation
import { validateForm } from 'js-laravel-validation'
const formData = {
username: {
value: 'test1',
validation: 'required|string'
},
password: {
value null,
validation: 'required|string'
}
}
const result = validateForm({ formData });
if (result.errors) {
console.log(formData.errors); // will be { password: 'required' }
}
Function Name | Description |
---|---|
validateForm(options) | Takes a number of options to validate the specified form data |
getMessage(rule, fieldData) | Gets an error message for the specified rule and field data |
setMessageHandler(rule, createMessage) | Sets or replaces the current message handler for the specified rule |
setMessageHandlers(messages) | Replaces multiple message handers |
getMessageHandler(rule) | Returns the current message handler function for the specified rule |
validateForm
Option | Description |
---|---|
formData | The form data to validate |
includeMessages | errors.field will be a message instead of rule name |
Function documentation to come
return new Date(value).format(params[0]) === value;
pair = params[i].split('='); namedParams = { [pair[0]]: pair[1] }
FAQs
Laravel style form validation for JavaScript
The npm package js-laravel-validation receives a total of 132 weekly downloads. As such, js-laravel-validation popularity was classified as not popular.
We found that js-laravel-validation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.