Skip to content

Commit

Permalink
fix(npm): fix version creation
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo committed Apr 30, 2022
1 parent e0ea1f1 commit 09dc35b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { readFileSync, writeFileSync } from "fs";

import GitHubRepositoriesProvider from "./gh-repos";
import NPMProvider from "./npm";
import { IPackage, Source, Tags, DataJson } from "./types";
import { IPackage, Source, Tags, DataJson, NPMVersions } from "./types";

// TEST

Expand Down Expand Up @@ -52,12 +52,12 @@ import { IPackage, Source, Tags, DataJson } from "./types";
// create verions array
if (packageContent.versions) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
for (const [key, value] of Object.entries(packageContent.versions)) {
if (key !== "created" && key !== "modified") {
for (const version of packageContent.versions) {
if (version.version !== "created" && version.version !== "modified") {
const versionObject = {
name: packageContent.name,
version: key,
date: value,
version: version.version,
date: version.date,
};
versionsArray.push(versionObject);
}
Expand Down
2 changes: 1 addition & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface IPackage {
gitHubRepo: string;
defaultBranch: string;
downloadsHistory?: PackageDownloadsHistory[];
versions?: any;
versions?: NPMVersions[];
}

export interface Tags {
Expand Down

0 comments on commit 09dc35b

Please sign in to comment.