mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +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) { | function addIfNotExists(meta, keyName, tagName, value) { | ||||||
| 	let exists = false; | 	const exists = meta.some(tag => tag[keyName] === tagName); | ||||||
| 	meta.forEach((tag) => { |  | ||||||
| 		if (tag[keyName] === tagName) { |  | ||||||
| 			exists = true; |  | ||||||
| 		} |  | ||||||
| 	}); |  | ||||||
|  |  | ||||||
| 	if (!exists && value) { | 	if (!exists && value) { | ||||||
| 		const data = { | 		const data = { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user