Skip to content

Commit fcd547f

Browse files
committed
chore: export types for security module
1 parent 818ee65 commit fcd547f

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export type { GenderType, NameModule, SexType } from './modules/name';
6060
export type { PhoneModule } from './modules/phone';
6161
export type { RandomModule } from './modules/random';
6262
export type { ChemicalElement, ScienceModule, Unit } from './modules/science';
63+
export type { Cvss, SecurityModule, SeverityRating } from './modules/security';
6364
export type { SystemModule } from './modules/system';
6465
export type { UniqueModule } from './modules/unique';
6566
export type { VehicleModule } from './modules/vehicle';

src/internal/toDate.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* If nothing or a non parseable value is passed, takes current date.
44
*
55
* @param date The input to convert to a date.
6+
*
7+
* @since 8.0.0
68
*/
79
export function toDate(date?: string | Date | number): Date {
810
date = new Date(date);

src/modules/security/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface Cvss {
3333
/**
3434
* Possible textual rating definitions for a CVSS identifier
3535
*/
36-
type SeverityRating = 'none' | 'low' | 'medium' | 'high' | 'critical';
36+
export type SeverityRating = 'none' | 'low' | 'medium' | 'high' | 'critical';
3737

3838
/**
3939
* Module to generate security related entries.
@@ -63,6 +63,8 @@ export class SecurityModule {
6363
* faker.security.cve({ from:'2020-01-01T00:00:00.000Z', to: '2030-01-01T00:00:00.000Z' }) // 'CVE-2028-0762'
6464
* faker.security.cve({ from:'2020-01-01T00:00:00.000Z' }) // 'CVE-2028-0762'
6565
* faker.security.cve({ to: '2019-12-31T00:00:00.000Z' }) // 'CVE-2018-0762'
66+
*
67+
* @since 8.0.0
6668
*/
6769
cve(
6870
options: {
@@ -89,6 +91,8 @@ export class SecurityModule {
8991
*
9092
* @example
9193
* faker.security.cwe() // 'CWE-123'
94+
*
95+
* @since 8.0.0
9296
*/
9397
cwe(): string {
9498
return ['CWE', this.faker.datatype.number({ min: 0, max: 1388 })].join('-');
@@ -101,6 +105,8 @@ export class SecurityModule {
101105
*
102106
* @example
103107
* faker.security.cvss() // { score: 3.8, vector: 'CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N/E:P/RL:W/RC:C', rating: 'low' }
108+
*
109+
* @since 8.0.0
104110
*/
105111
cvss(): Cvss {
106112
const score = this.faker.datatype.float({

0 commit comments

Comments
 (0)