Skip to content

Commit

Permalink
Bump version to 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
apih committed Aug 24, 2024
1 parent cd86372 commit dd2f765
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/locales/en.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* quival v0.4.0 (https://github.com/apih/quival)
* quival v0.4.1 (https://github.com/apih/quival)
* (c) 2023 Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>
* Released under the MIT License.
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/en.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/locales/ms.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* quival v0.4.0 (https://github.com/apih/quival)
* quival v0.4.1 (https://github.com/apih/quival)
* (c) 2023 Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>
* Released under the MIT License.
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/ms.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions dist/quival.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* quival v0.4.0 (https://github.com/apih/quival)
* quival v0.4.1 (https://github.com/apih/quival)
* (c) 2023 Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1309,7 +1309,9 @@ var quival = (function (exports) {
this.#implicitAttributes = {};
this.#stopOnFirstFailure = false;
this.#alwaysBail = false;
this.arrayRules = ['array', 'list'];
this.fileRules = ['file', 'image', 'mimetypes', 'mimes'];
this.stringRules = ['string', 'alpha', 'alpha_dash', 'alpha_num', 'ascii', 'email'];
this.numericRules = ['decimal', 'numeric', 'integer'];
this.sizeRules = ['size', 'between', 'min', 'max', 'gt', 'lt', 'gte', 'lte'];
this.setProperties(data, rules, messages, attributes, values);
Expand Down Expand Up @@ -1532,10 +1534,12 @@ var quival = (function (exports) {
if (!message) {
let key = rule;
if (this.sizeRules.includes(key)) {
if (Array.isArray(value) || isPlainObject(value) || this.hasRule(attribute, 'array')) {
if (Array.isArray(value) || isPlainObject(value) || this.hasRule(attribute, this.arrayRules)) {
key += '.array';
} else if (value instanceof File || this.hasRule(attribute, this.fileRules)) {
key += '.file';
} else if (this.hasRule(attribute, this.stringRules)) {
key += '.string';
} else if (isNumeric(value) || this.hasRule(attribute, this.numericRules)) {
key += '.numeric';
} else {
Expand Down Expand Up @@ -1602,6 +1606,8 @@ var quival = (function (exports) {
getSize(attribute, value) {
if (isEmpty(value)) {
return 0;
} else if (this.hasRule(attribute, this.stringRules)) {
return String(value).length;
} else if (isNumeric(value) && this.hasRule(attribute, this.numericRules)) {
return parseFloat(typeof value === 'string' ? value.trim() : value, 10);
} else if (value instanceof File) {
Expand Down
4 changes: 2 additions & 2 deletions dist/quival.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quival",
"version": "0.4.0",
"version": "0.4.1",
"description": "Data validation à la Laravel Validation",
"author": "Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>",
"license": "MIT",
Expand Down

0 comments on commit dd2f765

Please sign in to comment.