Skip to content

Commit

Permalink
Bump version to 0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
apih committed Dec 3, 2023
1 parent bbf53d9 commit 9325dd5
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 13 deletions.
5 changes: 4 additions & 1 deletion dist/locales/en.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* quival v0.2.6 (https://github.com/apih/quival)
* quival v0.2.7 (https://github.com/apih/quival)
* (c) 2023 Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>
* Released under the MIT License.
*/
Expand Down Expand Up @@ -31,6 +31,7 @@ this.quival.locales.en = (function () {
string: 'The :attribute field must be between :min and :max characters.',
},
boolean: 'The :attribute field must be true or false.',
can: 'The :attribute field contains an unauthorized value.',
confirmed: 'The :attribute field confirmation does not match.',
current_password: 'The password is incorrect.',
date: 'The :attribute field must be a valid date.',
Expand All @@ -50,6 +51,7 @@ this.quival.locales.en = (function () {
ends_with: 'The :attribute field must end with one of the following: :values.',
enum: 'The selected :attribute is invalid.',
exists: 'The selected :attribute is invalid.',
extensions: 'The :attribute field must have one of the following extensions: :values.',
file: 'The :attribute field must be a file.',
filled: 'The :attribute field must have a value.',
gt: {
Expand All @@ -64,6 +66,7 @@ this.quival.locales.en = (function () {
numeric: 'The :attribute field must be greater than or equal to :value.',
string: 'The :attribute field must be greater than or equal to :value characters.',
},
hex_color: 'The :attribute field must be a valid hexadecimal color.',
image: 'The :attribute field must be an image.',
in: 'The selected :attribute is invalid.',
in_array: 'The :attribute field must exist in :other.',
Expand Down
4 changes: 2 additions & 2 deletions dist/locales/en.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion dist/locales/ms.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* quival v0.2.6 (https://github.com/apih/quival)
* quival v0.2.7 (https://github.com/apih/quival)
* (c) 2023 Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>
* Released under the MIT License.
*/
Expand Down Expand Up @@ -31,6 +31,7 @@ this.quival.locales.ms = (function () {
string: 'Medan :attribute mesti antara :min dan :max huruf.',
},
boolean: 'Medan :attribute mesti benar atau salah.',
can: 'Medan :attribute field mengandungi nilai yang tidak dibenarkan.',
confirmed: 'Pengesahan medan :attribute tidak sepadan.',
current_password: 'Kata laluan tidak sah.',
date: 'Medan :attribute mesti tarikh yang sah.',
Expand All @@ -50,6 +51,7 @@ this.quival.locales.ms = (function () {
ends_with: 'Medan :attribute mesti berakhir dengan salah satu daripada berikut: :values.',
enum: 'Nilai :attribute yang dipilih tidak sah.',
exists: 'Nilai :attribute yang dipilih tidak sah.',
extensions: 'Medan :attribute mesti salah satu daripada sambungan berikut: :values.',
file: 'Medan :attribute mesti fail.',
filled: 'Medan :attribute mesti mempunyai nilai.',
gt: {
Expand All @@ -64,6 +66,7 @@ this.quival.locales.ms = (function () {
numeric: 'Medan :attribute mesti lebih besar daripada atau sama dengan :value.',
string: 'Medan :attribute mesti lebih besar daripada atau sama dengan :value huruf.',
},
hex_color: 'Medan :attribute mesti warna heksadesimal yang sah.',
image: 'Medan :attribute mesti imej.',
in: 'Nilai :attribute yang dipilih tidak sah.',
in_array: 'Medan :attribute mesti wujud dalam :other.',
Expand Down
4 changes: 2 additions & 2 deletions dist/locales/ms.min.js

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions dist/quival.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* quival v0.2.6 (https://github.com/apih/quival)
* quival v0.2.7 (https://github.com/apih/quival)
* (c) 2023 Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>
* Released under the MIT License.
*/
Expand Down Expand Up @@ -727,6 +727,9 @@ var quival = (function (exports) {
}
return false;
}
checkExtensions(attribute, value, parameters) {
return this.checkMimes(attribute, value, parameters);
}
async checkImage(attribute, value, parameters) {
let result = this.checkMimes(attribute, value, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp']);
if (!result || typeof FileReader === 'undefined') {
Expand Down Expand Up @@ -790,6 +793,9 @@ var quival = (function (exports) {
}
return true;
}
checkHexColor(attribute, value, parameters) {
return /^#(?:(?:[0-9a-f]{3}){1,2}|(?:[0-9a-f]{4}){1,2})$/i.test(value);
}
checkMacAddress(attribute, value, parameters) {
value = String(value);
const separators = {
Expand Down Expand Up @@ -1183,12 +1189,15 @@ var quival = (function (exports) {
replaceMimes(message, attribute, rule, parameters) {
return this.replaceMimetypes(message, attribute, rule, parameters);
}
replaceExtensions(message, attribute, rule, parameters) {
return this.replaceMimetypes(message, attribute, rule, parameters);
}
}

class Validator {
static #customCheckers = {};
static #customReplacers = {};
static #dummyRules = ['active_url', 'bail', 'current_password', 'enum', 'exclude', 'exclude_if', 'exclude_unless', 'exclude_with', 'exclude_without', 'exists', 'nullable', 'sometimes', 'unique'];
static #dummyRules = ['active_url', 'bail', 'can', 'current_password', 'enum', 'exclude', 'exclude_if', 'exclude_unless', 'exclude_with', 'exclude_without', 'exists', 'nullable', 'sometimes', 'unique'];
static #implicitRules = ['accepted', 'accepted_if', 'declined', 'declined_if', 'filled', 'missing', 'missing_if', 'missing_unless', 'missing_with', 'missing_with_all', 'present', 'required', 'required_if', 'required_if_accepted', 'required_unless', 'required_with', 'required_with_all', 'required_without', 'required_without_all'];
#data;
#rules;
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.2.6",
"version": "0.2.7",
"description": "Data validation à la Laravel Validation",
"author": "Mohd Hafizuddin M Marzuki <hafizuddin_83@yahoo.com>",
"license": "MIT",
Expand Down

0 comments on commit 9325dd5

Please sign in to comment.