Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improving the custom function with arrays of elements #332

Merged
merged 6 commits into from
Jul 28, 2024

Conversation

FerX
Copy link
Contributor

@FerX FerX commented Jul 14, 2023

I have enhanced the custom handling functionality to accommodate the reception of an array containing anonymous functions or function names defined in the global custom functions.

please refer to the detailed description provided in issue #328.

I require assistance in updating the documentation!

@FerX FerX marked this pull request as ready for review May 23, 2024 18:36
@FerX
Copy link
Contributor Author

FerX commented Jun 13, 2024

@icebob I have added documentation. It is ready for your evaluation. thanks.

@FerX
Copy link
Contributor Author

FerX commented Jun 14, 2024

@icebob I also added the use of shorthands and parameters

example:

const schema = {
	people:{
		type: "number",
		custom: [
            "compare|gte:-100|lt:200",  // short definition with additional parameters - equal to: {type:"compare",gte:-100, lt:200}, 
			"even",
			"real",
			function (value, errors){
				if(value === "3" ){
					errors.push({ type: "notPermitNumber",  actual: value });
				}
				return value;
			}
		]
	}
};

@icebob
Copy link
Owner

icebob commented Jul 28, 2024

Great job, thanks!

@icebob icebob merged commit 91ff68b into icebob:master Jul 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants