Skip to content

Commit

Permalink
Get name from branch on curated-extensions.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
damianmarti committed Nov 22, 2024
1 parent 89f44cc commit b6b8b99
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/curated-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ import { ExternalExtension } from "./types";
import extensions from "./extensions.json";

interface ExternalExtensionWithName extends ExternalExtension {
name: string;
name?: string;
}

const CURATED_EXTENSIONS: { [key: string]: ExternalExtension } = extensions
.map((extension: ExternalExtensionWithName) => {
let name = extension.name;
if (!name && extension.branch) {
name = extension.branch;
}
if (!name) {
throw new Error("Extension must have a name or branch");
}
return {
[extension.name]: {
[name]: {
repository: extension.repository,
branch: extension.branch,
},
Expand Down

0 comments on commit b6b8b99

Please sign in to comment.