Socket
Socket
Sign inDemoInstall

@lion/validate

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lion/validate - npm Package Compare versions

Comparing version 0.6.6 to 0.6.7

13

CHANGELOG.md

@@ -6,2 +6,15 @@ # Change Log

## [0.6.7](https://github.com/ing-bank/lion/compare/@lion/validate@0.6.6...@lion/validate@0.6.7) (2020-02-19)
### Bug Fixes
* **field:** do not validate disabled fields ([#586](https://github.com/ing-bank/lion/issues/586)) ([9127f08](https://github.com/ing-bank/lion/commit/9127f08440555fd08e11cc55315aa530dc09819b))
* **validate:** reset validation result on validators change ([#565](https://github.com/ing-bank/lion/issues/565)) ([ce6a89c](https://github.com/ing-bank/lion/commit/ce6a89c895652e62c5e9a4935c9b9ca2bf52d82c))
* reduce storybook chunck sizes for more performance ([9fc5606](https://github.com/ing-bank/lion/commit/9fc560605f5dcf6e9abcf8d58079c59f12750046))
## [0.6.6](https://github.com/ing-bank/lion/compare/@lion/validate@0.6.5...@lion/validate@0.6.6) (2020-02-06)

@@ -8,0 +21,0 @@

14

package.json
{
"name": "@lion/validate",
"version": "0.6.6",
"version": "0.6.7",
"description": "Validate your form elements",

@@ -17,3 +17,5 @@ "author": "ing-bank",

"scripts": {
"prepublishOnly": "../../scripts/npm-prepublish.js"
"prepublishOnly": "../../scripts/npm-prepublish.js",
"test": "cd ../../ && yarn test --grep \"packages/validate/test/**/*.test.js\"",
"test:watch": "cd ../../ && yarn test:watch --grep \"packages/validate/test/**/*.test.js\""
},

@@ -38,11 +40,11 @@ "keywords": [

"dependencies": {
"@lion/core": "0.4.3",
"@lion/localize": "0.8.6"
"@lion/core": "0.4.4",
"@lion/localize": "0.8.7"
},
"devDependencies": {
"@open-wc/demoing-storybook": "^1.8.3",
"@open-wc/demoing-storybook": "^1.10.4",
"@open-wc/testing": "^2.5.0",
"sinon": "^7.2.2"
},
"gitHead": "d67225984ce359c421e1c1e350da98819f83e452"
"gitHead": "417b37a61695128619c6040a6523819c51f51651"
}

@@ -59,7 +59,7 @@ # Validate

execute(value) {
let hasError = false;
let hasFeedback = false;
if (!IsString || !isInitialsRegex.test(value.toLowerCase())) {
hasError = true;
hasFeedback = true;
}
return hasError;
return hasFeedback;
}

@@ -66,0 +66,0 @@

@@ -203,3 +203,3 @@ /* eslint-disable class-methods-use-this, camelcase, no-param-reassign, max-classes-per-file */

this.__setupValidators();
this.validate();
this.validate({ clearCurrentResult: true });
} else if (name === 'modelValue') {

@@ -265,2 +265,8 @@ this.validate({ clearCurrentResult: true });

async validate({ clearCurrentResult } = {}) {
if (this.disabled) {
this.__clearValidationResults();
this.__validationResult = [];
this._updateFeedbackComponent();
return;
}
if (!this.__validateInitialized) {

@@ -267,0 +273,0 @@ return;

@@ -815,2 +815,21 @@ import { expect, fixture, html, unsafeStatic, defineCE, aTimeout } from '@open-wc/testing';

it('clears current validation results when validators array updated', async () => {
const validators = [new Required()];
const el = await fixture(html`
<${tag}
.validators=${validators}
>${lightDom}</${tag}>
`);
expect(el.hasFeedbackFor).to.deep.equal(['error']);
expect(el.validationStates.error).to.eql({ Required: true });
el.validators = [];
expect(el.hasFeedbackFor).to.not.deep.equal(['error']);
expect(el.validationStates.error).to.eql({});
el.validators = [new Required()];
expect(el.hasFeedbackFor).to.deep.equal(['error']);
expect(el.validationStates.error).to.not.eql({});
});
describe('Events', () => {

@@ -817,0 +836,0 @@ it('fires "showsFeedbackForChanged" event async after feedbackData got synced to feedbackElement', async () => {

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