aboutsummaryrefslogtreecommitdiff
path: root/src/modules/system
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2024-11-14 22:50:04 +0100
committerGitHub <[email protected]>2024-11-14 21:50:04 +0000
commit188309a59cfe6fbd33e120dedf3bdfef3276d641 (patch)
tree079d062e07065b11ae0bcf8c8cb964174a842080 /src/modules/system
parenta54c1edb87e88b198966d248d5273c9898c32798 (diff)
downloadfaker-188309a59cfe6fbd33e120dedf3bdfef3276d641.tar.xz
faker-188309a59cfe6fbd33e120dedf3bdfef3276d641.zip
infra(unicorn): consistent-function-scoping (#3255)
Diffstat (limited to 'src/modules/system')
-rw-r--r--src/modules/system/index.ts21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/modules/system/index.ts b/src/modules/system/index.ts
index aec3525e..1c387e51 100644
--- a/src/modules/system/index.ts
+++ b/src/modules/system/index.ts
@@ -263,17 +263,17 @@ export class SystemModule extends ModuleBase {
let suffix: string;
let prefix = '';
- const digit = () => this.faker.string.numeric({ allowLeadingZeros: true });
switch (interfaceSchema) {
case 'index': {
- suffix = digit();
+ suffix = this.faker.string.numeric();
break;
}
case 'slot': {
- suffix = `${digit()}${
- this.faker.helpers.maybe(() => `f${digit()}`) ?? ''
- }${this.faker.helpers.maybe(() => `d${digit()}`) ?? ''}`;
+ suffix = `${this.faker.string.numeric()}${
+ this.faker.helpers.maybe(() => `f${this.faker.string.numeric()}`) ??
+ ''
+ }${this.faker.helpers.maybe(() => `d${this.faker.string.numeric()}`) ?? ''}`;
break;
}
@@ -283,10 +283,13 @@ export class SystemModule extends ModuleBase {
}
case 'pci': {
- prefix = this.faker.helpers.maybe(() => `P${digit()}`) ?? '';
- suffix = `${digit()}s${digit()}${
- this.faker.helpers.maybe(() => `f${digit()}`) ?? ''
- }${this.faker.helpers.maybe(() => `d${digit()}`) ?? ''}`;
+ prefix =
+ this.faker.helpers.maybe(() => `P${this.faker.string.numeric()}`) ??
+ '';
+ suffix = `${this.faker.string.numeric()}s${this.faker.string.numeric()}${
+ this.faker.helpers.maybe(() => `f${this.faker.string.numeric()}`) ??
+ ''
+ }${this.faker.helpers.maybe(() => `d${this.faker.string.numeric()}`) ?? ''}`;
break;
}
}