File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313 Occurrence ,
1414 Validity ,
1515} from "./api-types" ;
16+ import { pluralize } from "../utils" ;
1617
1718const validityDisplayName : Record < Validity , string > = {
1819 unknown : "Unknown" ,
@@ -46,9 +47,6 @@ function filterUriOccurrences(occurrences: Occurrence[]): Occurrence[] {
4647 * @returns incidents diagnostics
4748 */
4849
49- const pluralize = ( num : number , word : string , plural = word + "s" ) =>
50- [ 1 , - 1 ] . includes ( Number ( num ) ) ? word : plural ;
51-
5250export function parseGGShieldResults (
5351 results : GGShieldScanResults ,
5452) : Diagnostic [ ] {
Original file line number Diff line number Diff line change @@ -29,3 +29,7 @@ export function getCurrentFile(): string {
2929 return "" ;
3030 }
3131}
32+
33+ export function pluralize ( num : number , word : string ) : string {
34+ return `${ [ 1 , - 1 ] . includes ( num ) ? word : word + "s" } `
35+ }
You can’t perform that action at this time.
0 commit comments