Skip to content

Conversation

@alexeymarunin
Copy link

I tried to resolve #15

const schema = {
	id: { type: "number", positive: true, integer: true, convert: true },
	name: { type: "string", min: 3, max: 255 },
	status: { type: "boolean", convert: true }
};

const data = { id: "5", name: "John", status: "1" };
console.log(v.validate(data, schema), data);
// Returns: true { id: 5, name: 'John', status: true }

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 99.16% when pulling 3344b12 on alexeymarunin:master into a5f2b05 on icebob:master.

@alexeymarunin
Copy link
Author

@icebob is it any problems to submit the request?
This feature is important for our project

@icebob
Copy link
Owner

icebob commented Jun 5, 2019

Yes, because it is a breaking change. Because it modifies the original object.

@icebob
Copy link
Owner

icebob commented Nov 10, 2019

#94

@icebob icebob closed this Nov 10, 2019
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.

convert true to boolean don't actual converts the value.

3 participants