build(aio): create minLength content rule (#22759)
This rule can be used to ensure that properties contain a minimum number of characters. PR Close #22759
This commit is contained in:

committed by
Igor Minar

parent
1619160c8a
commit
fa11d7822c
8
aio/tools/transforms/angular-api-package/content-rules/minLength.js
vendored
Normal file
8
aio/tools/transforms/angular-api-package/content-rules/minLength.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
module.exports = function createMinLengthRule(minLength) {
|
||||
minLength = minLength || 2;
|
||||
return (doc, prop, value) => {
|
||||
if (value.length < minLength) {
|
||||
return `Invalid "${prop}" property: "${value}". It must have at least ${minLength} characters.`;
|
||||
}
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user