Skip to content

Commit 0b37303

Browse files
authored
Merge pull request #476 from NodeSecure/fix-ts-error
fix: typescript error that make build fail
2 parents af2ebed + a6f1070 commit 0b37303

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
run: npx puppeteer browsers install chrome
3333
- name: Install dependencies
3434
run: npm install --ignore-scripts
35+
- name: build
36+
run: npm run build
3537
- name: Lint
3638
run: npm run lint
3739
- name: Run tests

src/analysis/extractScannerData.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import fs from "node:fs";
44
// Import Third-party Dependencies
55
import { getScoreColor, getVCSRepositoryPathAndPlatform } from "@nodesecure/utils";
66
import { getManifest, getFlags } from "@nodesecure/flags/web";
7-
import { Extractors, type Payload, type Dependency, type DependencyVersion, type DependencyLinks } from "@nodesecure/scanner";
7+
import { Extractors, type Payload } from "@nodesecure/scanner";
88
import type { RC } from "@nodesecure/rc";
99

1010
// Import Internal Dependencies
@@ -123,11 +123,8 @@ export function buildStatsFromScannerDependencies(
123123
new Extractors.Probes.NodeDependencies()
124124
]);
125125

126-
extractor.on("manifest", (spec: string,
127-
{ flags, links = [] }: Omit<DependencyVersion, "links"> & {
128-
links: DependencyLinks | never[];
129-
},
130-
{ name }: { name: string; dependency: Dependency; }) => {
126+
extractor.on("manifest", (spec: string, dependencyVersion, { name }) => {
127+
const { flags, links = [] } = dependencyVersion;
131128
const isThird = npmConfig.organizationPrefix === null ?
132129
true :
133130
!name.startsWith(`${npmConfig.organizationPrefix}/`);

src/analysis/fetch.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ async function fetchRepositoriesStats(
106106

107107
const scoresCache = new Map<string, number>();
108108

109-
export async function fetchScorecardScore(fullName: string) {
109+
export async function fetchScorecardScore(
110+
fullName: string
111+
): Promise<number> {
110112
if (scoresCache.has(fullName)) {
111-
return scoresCache.get(fullName);
113+
return scoresCache.get(fullName)!;
112114
}
113115
try {
114116
const { score } = await scorecard.result(fullName, { resolveOnVersionControl: false });

0 commit comments

Comments
 (0)