mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
refactor: use array.some
This commit is contained in:
@@ -187,12 +187,7 @@ Tags.parse = async (req, data, meta, link) => {
|
||||
};
|
||||
|
||||
function addIfNotExists(meta, keyName, tagName, value) {
|
||||
let exists = false;
|
||||
meta.forEach((tag) => {
|
||||
if (tag[keyName] === tagName) {
|
||||
exists = true;
|
||||
}
|
||||
});
|
||||
const exists = meta.some(tag => tag[keyName] === tagName);
|
||||
|
||||
if (!exists && value) {
|
||||
const data = {
|
||||
|
||||
Reference in New Issue
Block a user