Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4bc121e

Browse files
committedMar 18, 2025
Bump version to 0.5.0
1 parent c0c736b commit 4bc121e

File tree

8 files changed

+24
-20
lines changed

8 files changed

+24
-20
lines changed
 

‎dist/locales/en.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* quival v0.4.2 (https://github.com/apih/quival)
2+
* quival v0.5.0 (https://github.com/apih/quival)
33
* (c) 2023 Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>
44
* Released under the MIT License.
55
*/

‎dist/locales/en.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/locales/ms.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* quival v0.4.2 (https://github.com/apih/quival)
2+
* quival v0.5.0 (https://github.com/apih/quival)
33
* (c) 2023 Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>
44
* Released under the MIT License.
55
*/

‎dist/locales/ms.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/quival.js

+15-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* quival v0.4.2 (https://github.com/apih/quival)
2+
* quival v0.5.0 (https://github.com/apih/quival)
33
* (c) 2023 Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>
44
* Released under the MIT License.
55
*/
@@ -240,10 +240,10 @@ var quival = (function (exports) {
240240
collectMissingsThenTest(attribute, value, parameters, callback) {
241241
let result = [];
242242
for (const other of parameters) {
243-
result.push(this.checkMissing(other));
243+
result.push(this.checkMissing(other, this.validator.getValue(other)));
244244
}
245245
if (callback(result)) {
246-
return this.checkMissing(attribute);
246+
return this.checkMissing(attribute, value);
247247
}
248248
return true;
249249
}
@@ -447,17 +447,17 @@ var quival = (function (exports) {
447447
}
448448
// Missing
449449
checkMissing(attribute, value, parameters) {
450-
return !this.validator.hasAttribute(attribute);
450+
return typeof value === 'undefined';
451451
}
452452
checkMissingIf(attribute, value, parameters) {
453453
if (this.isDependent(parameters)) {
454-
return this.checkMissing(attribute);
454+
return this.checkMissing(attribute, value);
455455
}
456456
return true;
457457
}
458458
checkMissingUnless(attribute, value, parameters) {
459459
if (!this.isDependent(parameters)) {
460-
return this.checkMissing(attribute);
460+
return this.checkMissing(attribute, value);
461461
}
462462
return true;
463463
}
@@ -751,7 +751,11 @@ var quival = (function (exports) {
751751
return this.checkMimes(attribute, value, parameters);
752752
}
753753
async checkImage(attribute, value, parameters) {
754-
let result = this.checkMimes(attribute, value, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp']);
754+
const mimes = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
755+
if (parameters.includes('allow_svg')) {
756+
mimes.push('svg');
757+
}
758+
let result = this.checkMimes(attribute, value, mimes);
755759
if (!result || typeof FileReader === 'undefined') {
756760
return result;
757761
}
@@ -1437,7 +1441,7 @@ var quival = (function (exports) {
14371441
this.#checkers.clearCaches();
14381442
this.#errors = new ErrorBag();
14391443
const tasks = [];
1440-
const skippedAttributes = [];
1444+
const skippedAttributes = new Set();
14411445
for (const [attribute, rules] of Object.entries(this.#rules)) {
14421446
for (const [rule] of rules) {
14431447
if (
@@ -1454,7 +1458,7 @@ var quival = (function (exports) {
14541458
let value = this.getValue(attribute);
14551459
const hasRule = (ruleName) => rules.some((rule) => rule[0] === ruleName);
14561460
if (hasRule('sometimes') && typeof value === 'undefined') {
1457-
skippedAttributes.push(attribute);
1461+
skippedAttributes.add(attribute);
14581462
continue;
14591463
}
14601464
tasks.push(async () => {
@@ -1468,7 +1472,7 @@ var quival = (function (exports) {
14681472
!Validator.#implicitRules.includes(rule) &&
14691473
(typeof value === 'undefined' || (typeof value === 'string' && value.trim() === '') || (isNullable && value === null)))
14701474
) {
1471-
skippedAttributes.push(attribute);
1475+
skippedAttributes.add(attribute);
14721476
continue;
14731477
}
14741478
let result, success, message;
@@ -1520,7 +1524,7 @@ var quival = (function (exports) {
15201524
});
15211525
this.#errors.sortByKeys(Object.keys(this.#rules));
15221526
}
1523-
this.#skippedAttributes = skippedAttributes.filter((value, index, array) => array.indexOf(value) === index);
1527+
this.#skippedAttributes = [...skippedAttributes];
15241528
return this.#errors;
15251529
}
15261530
async passes() {

‎dist/quival.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quival",
3-
"version": "0.4.2",
3+
"version": "0.5.0",
44
"description": "Data validation à la Laravel Validation",
55
"author": "Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>",
66
"license": "MIT",

0 commit comments

Comments
 (0)
Please sign in to comment.