maximecb/noisecraft

Node & project state validation

maximecb opened this issue · 1 comments

At the moment when editing the parameters of a node, we don't do any validation. We should be validating that parameters like minVal, maxVal and value are all numbers and that minVal <= maxVal. There's also probably more validation to do on the types of other parameters.

Ideally, we would also validate other values in the node state, and reusing this validation code when project sharing requests are made on the server side. We don't need to do much validation when copying and pasting because we just have to assume that browsers on the client-side could be compromised.

This code should be located in model.js, probably in a function we call validateNode(node). We may also want to implement a validateProject(project) for use on the server side. These are to assume plain JSON objects and should be written defensively (assume malicious input is possible).

This is now complete and working :)