futrther improvements to anonymization

This commit is contained in:
zadam
2020-06-07 10:20:48 +02:00
parent be7ac74235
commit e8cd821e57
3 changed files with 27 additions and 8 deletions

View File

@@ -115,13 +115,24 @@ function isAttributeType(type) {
}
function isAttributeDangerous(type, name) {
return BUILTIN_ATTRIBUTES.some(attr =>
attr.type === attr.type &&
return BUILTIN_ATTRIBUTES.some(attr =>
attr.type === attr.type &&
attr.name.toLowerCase() === name.trim().toLowerCase() &&
attr.isDangerous
);
}
function getBuiltinAttributeNames() {
return BUILTIN_ATTRIBUTES
.map(attr => attr.name)
.concat([
'internalLink',
'imageLink',
'includeNoteLink',
'relationMapLink'
]);
}
module.exports = {
getNotesWithLabel,
getNotesWithLabels,
@@ -131,5 +142,6 @@ module.exports = {
createAttribute,
getAttributeNames,
isAttributeType,
isAttributeDangerous
};
isAttributeDangerous,
getBuiltinAttributeNames
};