validate/clean inverse relation name in promoted attr definition

This commit is contained in:
zadam
2021-10-27 22:13:54 +02:00
parent bcabe5786f
commit 79b8d91025
3 changed files with 10 additions and 3 deletions

View File

@@ -298,6 +298,10 @@ function normalize(str) {
return removeDiacritic(str).toLowerCase();
}
function filterAttributeName(name) {
return name.replace(/[^\p{L}\p{N}_:]/ug, "");
}
module.exports = {
randomSecureToken,
randomString,
@@ -331,5 +335,6 @@ module.exports = {
timeLimit,
deferred,
removeDiacritic,
normalize
normalize,
filterAttributeName
};