Skip to content

Commit 0363caa

Browse files
committed
fix(mock): replace negated conditions to satisfy unicorn/no-negated-condition
1 parent 932fa58 commit 0363caa

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

packages/mock/src/faker/getters/scalar.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,13 @@ export function getMockScalar({
268268
}
269269

270270
const arrMin = (item.minItems ??
271-
(item.maxItems !== undefined ? 1 : safeMockOptions.arrayMin)) as
271+
(item.maxItems === undefined ? safeMockOptions.arrayMin : 1)) as
272272
| number
273273
| undefined;
274274
const arrMax = (item.maxItems ??
275-
(item.minItems !== undefined
276-
? undefined
277-
: safeMockOptions.arrayMax)) as number | undefined;
275+
(item.minItems === undefined
276+
? safeMockOptions.arrayMax
277+
: undefined)) as number | undefined;
278278
const arrParts: string[] = [];
279279
if (arrMin !== undefined) arrParts.push(`min: ${arrMin}`);
280280
if (arrMax !== undefined) arrParts.push(`max: ${arrMax}`);
@@ -293,13 +293,13 @@ export function getMockScalar({
293293

294294
case 'string': {
295295
const strMin = (item.minLength ??
296-
(item.maxLength !== undefined ? 1 : safeMockOptions.stringMin)) as
296+
(item.maxLength === undefined ? safeMockOptions.stringMin : 1)) as
297297
| number
298298
| undefined;
299299
const strMax = (item.maxLength ??
300-
(item.minLength !== undefined
301-
? undefined
302-
: safeMockOptions.stringMax)) as number | undefined;
300+
(item.minLength === undefined
301+
? safeMockOptions.stringMax
302+
: undefined)) as number | undefined;
303303
const strLenParts: string[] = [];
304304
if (strMin !== undefined) strLenParts.push(`min: ${strMin}`);
305305
if (strMax !== undefined) strLenParts.push(`max: ${strMax}`);

0 commit comments

Comments
 (0)