Skip to content

Commit

Permalink
Merge branch 'next' into infra/unicorn/no-array-reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Nov 7, 2023
2 parents d663115 + 9498203 commit 5a76bd6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ module.exports = defineConfig({
'unicorn/import-style': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/no-object-as-default-parameter': 'off',
'unicorn/no-useless-switch-case': 'off',
'unicorn/numeric-separators-style': 'off',
Expand Down
4 changes: 2 additions & 2 deletions scripts/apidoc/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ async function loadRemote(url: string): Promise<DocsApiDiffIndex> {
throw new Error(
`Failed to load remote diff index from ${url}: ${res.statusText}`
);
} else {
return res.json() as Promise<DocsApiDiffIndex>;
}

return res.json() as Promise<DocsApiDiffIndex>;
});
}

Expand Down
22 changes: 11 additions & 11 deletions src/modules/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`;
}

Expand Down

0 comments on commit 5a76bd6

Please sign in to comment.