Closed angeloashmore closed 9 years ago
I believe this is working as desired. toString
is a function that is used internally in javascript when converting an object to a string. You can call it using result.toString()
, or it will be called when there is an implicit conversion to a string. (e.g. if you concatenate a validation result with a string: log("Result: " + result)
)
The output you pasted looks like the result of logging a validation result. Many loggers will put [Function]
in the output where there is a method on an object, rather than print the entire method. If you are really just interested in a string representation of the result then either log result.toString()
, or to concatenate the result with another string "Result: " + result
Also, please comment again if I didn't understand the issue.
Oh I see. I misunderstood the purpose of it. Thanks for clarifying!
No problem, hope that helps!
Validation result's
toString
property returns[Function]
.Solution
https://github.com/Prestaul/skeemas/blob/master/validation-result.js#L12
Change:
To: