aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-11-07 17:12:47 +0100
committerGitHub <[email protected]>2023-11-07 16:12:47 +0000
commit9498203190e37a96114ddc8e861b02ccd94e517b (patch)
treebf605df537b387d1d33fe2707f3d46b9b4afed44 /src/modules
parentfafcba473f8a91eeb8230ebdc1ad5039b25091e1 (diff)
downloadfaker-9498203190e37a96114ddc8e861b02ccd94e517b.tar.xz
faker-9498203190e37a96114ddc8e861b02ccd94e517b.zip
infra(unicorn): no-negated-condition (#2507)
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/helpers/index.ts22
-rw-r--r--src/modules/image/index.ts2
2 files changed, 12 insertions, 12 deletions
diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts
index ff93f2ca..f7d9538b 100644
--- a/src/modules/helpers/index.ts
+++ b/src/modules/helpers/index.ts
@@ -456,17 +456,7 @@ export class SimpleHelpersModule extends SimpleModuleBase {
}
while (range != null) {
- if (!range[0].includes('-')) {
- // handle non-ranges
- if (isCaseInsensitive && Number.isNaN(Number(range[0]))) {
- rangeCodes.push(
- range[0].toUpperCase().charCodeAt(0),
- range[0].toLowerCase().charCodeAt(0)
- );
- } else {
- rangeCodes.push(range[0].charCodeAt(0));
- }
- } else {
+ if (range[0].includes('-')) {
// handle ranges
const rangeMinMax = range[0].split('-').map((x) => x.charCodeAt(0));
min = rangeMinMax[0];
@@ -490,6 +480,16 @@ export class SimpleHelpersModule extends SimpleModuleBase {
rangeCodes.push(i);
}
}
+ } else {
+ // handle non-ranges
+ if (isCaseInsensitive && Number.isNaN(Number(range[0]))) {
+ rangeCodes.push(
+ range[0].toUpperCase().charCodeAt(0),
+ range[0].toLowerCase().charCodeAt(0)
+ );
+ } else {
+ rangeCodes.push(range[0].charCodeAt(0));
+ }
}
ranges = ranges.substring(range[0].length);
diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts
index 915014db..f5f24711 100644
--- a/src/modules/image/index.ts
+++ b/src/modules/image/index.ts
@@ -175,7 +175,7 @@ export class ImageModule extends ModuleBase {
const { width = 640, height = 480, category } = options;
return `https://loremflickr.com/${width}/${height}${
- category != null ? `/${category}` : ''
+ category == null ? '' : `/${category}`
}?lock=${this.faker.number.int()}`;
}