diff options
author | RabsRincon <ruben@rinconblanco.es> | 2022-02-06 21:20:00 +0100 |
---|---|---|
committer | RabsRincon <ruben@rinconblanco.es> | 2022-02-06 21:20:00 +0100 |
commit | 884dbe6c96e72db9cec779acf7a65c1dfaaf7d56 (patch) | |
tree | b8d5dac41bd9408b23a65d8ab9ad89f9cd76fa25 | |
parent | aab5ae588c77b24bc23e18c378d9b013f6868726 (diff) | |
download | compiler-explorer-gh-1870.tar.gz compiler-explorer-gh-1870.zip |
Address review commentsgh-1870
-rw-r--r-- | static/history.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/static/history.ts b/static/history.ts index 59df1250d..66a661a2a 100644 --- a/static/history.ts +++ b/static/history.ts @@ -28,11 +28,12 @@ import { Sharing } from './sharing'; const maxHistoryEntries = 30; +type Source = {dt: number, source: string}; type HistoryEntry = {dt: number, sources: EditorSource[], config: any}; type EditorSource = {lang: string, source: string}; function extractEditorSources(content: any[]): EditorSource[] { - const sources = []; + const sources: EditorSource[] = []; for (const component of content) { if (component.content) { const subsources = extractEditorSources(component.content); @@ -112,8 +113,8 @@ export function sortedList() { return list().sort((a, b) => b.dt - a.dt); } -export function sources(language: string): {dt: number, source: string}[] { - const sourcelist = []; +export function sources(language: string): Source[] { + const sourcelist: Source[] = []; for (const entry of sortedList()) { for (const source of entry.sources) { if (source.lang === language) { |