
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@apatheticwes/validator
Advanced tools
A simple and extendable client-side form Validator.
This a simple, extensible client-side validation class. It's "simple" because it includes only a small and basic set of validation functions. However, it's easily extensible so you may add your own types of custom validation.
While most other Validators require a particular accompanying Javascript framework, this one does not. Additionally, rather than a bloaty, full-featured validator, the approach taken herein is to create a basic validator that covers most general use-cases. If it doesn't cover yours, you can easily add any required functionality.
npm install @apathetic/validator
git clone git@github.com:apathetic/validator.git
There is an ES6 module you may consume however you wish. Then:
Check a form
var form = document.querySelector('#userForm');
var valid = Validator.check(form);
Check a field
var field = document.querySelector('#email');
var valid = Validator.check(field);
<input id="email" name="email" data-validate="email" required />
Add a custom rule
// add a rule called "count" that checks an input's length
Validator.updateRule('count', function count(val) {
return val.length <= 40;
});
<textarea data-validate="count" required>40 characters or less, here</textarea>
| method | args | description | | ------ | ----------- | | check() | element (HTMLElement), success (Function) | Pass in a field or a DOM fragment. Checks if field (or fields within the fragment) are valid according to any data-validate/required attributes | | updateRule() | name (String), validator (Function) | Add your own validation function. The validation function receives the field value to check against. Use your new rule by placing data-validate="name" on a field |
After cloning the repo:
npm i
npm start
A server will spin up at http://localhost:8080
, where you may play with the various examples.
Please see the test / demo directory
FAQs
A simple, extendable client-side valiator
The npm package @apatheticwes/validator receives a total of 3 weekly downloads. As such, @apatheticwes/validator popularity was classified as not popular.
We found that @apatheticwes/validator 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.