Correction Stringium pour bien prendre en compte les tags des chaines strings (ex: ios,droid, iosonly...-
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2022-08-08 12:14:18 +02:00
parent 150445b906
commit e3f90e0d48
3 changed files with 27 additions and 6 deletions

View File

@ -36,6 +36,13 @@ class Definition {
return Definition(name: definitionName)
}
func hasOneOrMoreMatchingTags(inputTags: [String]) -> Bool {
if Set(inputTags).intersection(Set(self.tags)).isEmpty {
return false
}
return true
}
// MARK: -
private func getStringParameters(input: String) -> (inputParameters: [String], translationArguments: [String])? {

View File

@ -28,12 +28,12 @@ class Section {
func hasOneOrMoreMatchingTags(tags: [String]) -> Bool {
let allTags = definitions.flatMap { $0.tags }
let allTagsSet = Set(allTags)
for tag in tags {
if allTags.contains(tag) {
return true
}
let intersection = Set(tags).intersection(allTagsSet)
if intersection.isEmpty {
return false
}
return false
return true
}
}