A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/GlobalNamesArchitecture/gnparser/commit/463045a795b714ce9a411fe530fdbaffd7d5444d below:

avoid multiple `year` key in authorship · GlobalNamesArchitecture/gnparser@463045a · GitHub

This repository was archived by the owner on Jun 17, 2023. It is now read-only.

File tree Expand file treeCollapse file tree 2 files changed

+179

-177

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+179

-177

lines changed Original file line number Diff line number Diff line change

@@ -87,8 +87,10 @@ class DetailsRenderer(result: parser.Result) {

87 87

def detailedAuthorship(as: ast.Authorship): JObject = {

88 88

def detailedAuthor(a: ast.Author): String = result.normalizedAuthor(a)

89 89

def detailedAuthorsTeam(at: ast.AuthorsTeam): JObject = {

90 -

val res: JObject = "authors" -> at.authors.map(detailedAuthor)

91 -

at.years.foldLeft(res) { (r, y) => r ~ ("year" -> detailedYear(y)) }

90 +

val authors = "authors" -> at.authors.map(detailedAuthor)

91 +

val years = at.years.map { detailedYear }

92 +

val yearsJson = "years" -> (years.isEmpty ? (JNothing: JValue) | years)

93 +

authors ~ yearsJson

92 94

}

93 95

def detailedAuthorsGroup(ag: ast.AuthorsGroup): JObject =

94 96

detailedAuthorsTeam(ag.authors) ~

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4