aboutsummaryrefslogtreecommitdiff
path: root/src/modules/helpers/index.ts
diff options
context:
space:
mode:
authorShinigami <[email protected]>2023-02-15 19:29:44 +0100
committerGitHub <[email protected]>2023-02-15 18:29:44 +0000
commite7230f6f10af9633cf0eca18910cbafaaba9ecba (patch)
tree60c27d30661f85b8ec2155e8a2f39ffdb8559f63 /src/modules/helpers/index.ts
parent1399375686afb99a4ea55a6153601905f395304d (diff)
downloadfaker-e7230f6f10af9633cf0eca18910cbafaaba9ecba.tar.xz
faker-e7230f6f10af9633cf0eca18910cbafaaba9ecba.zip
chore: activate noImplicitAny (#1839)
Diffstat (limited to 'src/modules/helpers/index.ts')
-rw-r--r--src/modules/helpers/index.ts18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts
index c22a3612..55732f4a 100644
--- a/src/modules/helpers/index.ts
+++ b/src/modules/helpers/index.ts
@@ -10,7 +10,9 @@ import * as uniqueExec from './unique';
export class HelpersModule {
constructor(private readonly faker: Faker) {
// Bind `this` so namespaced is working correctly
- for (const name of Object.getOwnPropertyNames(HelpersModule.prototype)) {
+ for (const name of Object.getOwnPropertyNames(
+ HelpersModule.prototype
+ ) as Array<keyof HelpersModule | 'constructor'>) {
if (name === 'constructor' || typeof this[name] !== 'function') {
continue;
}
@@ -804,8 +806,10 @@ export class HelpersModule {
// Search for the requested method or definition
for (const part of parts) {
- currentModuleOrMethod = currentModuleOrMethod?.[part];
- currentDefinitions = currentDefinitions?.[part];
+ currentModuleOrMethod =
+ currentModuleOrMethod?.[part as keyof typeof currentModuleOrMethod];
+ currentDefinitions =
+ currentDefinitions?.[part as keyof typeof currentDefinitions];
}
// Make method executable
@@ -903,7 +907,13 @@ export class HelpersModule {
*
* @since 7.5.0
*/
- unique<Method extends (...parameters) => RecordKey>(
+ unique<
+ Method extends (
+ // TODO christopher 2023-02-14: This `any` type can be fixed by anyone if they want to.
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ ...parameters: any[]
+ ) => RecordKey
+ >(
method: Method,
args?: Parameters<Method>,
options: {