MCPcopy
hub / github.com/codedogQBY/ReadAny / formatLanguageMap

Function formatLanguageMap

packages/foliate-js/reader.js:51–56  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

49const listFormat = new Intl.ListFormat(locales, { style: "short", type: "conjunction" });
50
51const formatLanguageMap = (x) => {
52 if (!x) return "";
53 if (typeof x === "string") return x;
54 const keys = Object.keys(x);
55 return x[keys[0]];
56};
57
58const formatOneContributor = (contributor) =>
59 typeof contributor === "string" ? contributor : formatLanguageMap(contributor?.name);

Callers 2

formatOneContributorFunction · 0.85
openMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected