MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / customWordCountValidator

Function customWordCountValidator

utils/customWordCountValidator.js:8–16  ·  view source on GitHub ↗
(value, helpers, wordCount)

Source from the content-addressed store, hash-verified

6 * @returns {*} The validated value if the word count is met, otherwise an error.
7 */
8const customWordCountValidator = (value, helpers, wordCount) => {
9 const words = value.split(/\s+/);
10
11 if (words.length < wordCount) {
12 return helpers.error("any.invalid");
13 }
14
15 return value;
16};
17
18module.exports = {
19 customWordCountValidator,

Callers 4

validateApplicationDataFunction · 0.90
validateJoinDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected