aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.eslintrc.js1
-rw-r--r--src/modules/helpers/index.ts2
-rw-r--r--src/modules/helpers/unique.ts4
-rw-r--r--test/modules/helpers.spec.ts2
4 files changed, 4 insertions, 5 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index 4e8dda50..1c8d5096 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -76,7 +76,6 @@ module.exports = defineConfig({
'unicorn/prefer-array-flat-map': 'off',
'unicorn/prefer-array-some': 'off',
'unicorn/prefer-code-point': 'off',
- 'unicorn/prefer-date-now': 'off',
'unicorn/prefer-export-from': 'off',
'unicorn/prefer-includes': 'off',
'unicorn/prefer-module': 'off',
diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts
index f5e7e177..7ace1e91 100644
--- a/src/modules/helpers/index.ts
+++ b/src/modules/helpers/index.ts
@@ -1181,7 +1181,7 @@ export class SimpleHelpersModule {
} = options;
return uniqueExec.exec(method, args, {
...options,
- startTime: new Date().getTime(),
+ startTime: Date.now(),
maxTime,
maxRetries,
currentIterations: 0,
diff --git a/src/modules/helpers/unique.ts b/src/modules/helpers/unique.ts
index c096854a..86040445 100644
--- a/src/modules/helpers/unique.ts
+++ b/src/modules/helpers/unique.ts
@@ -89,10 +89,10 @@ export function exec<
store?: Record<RecordKey, RecordKey>;
} = {}
): ReturnType<TMethod> {
- const now = new Date().getTime();
+ const now = Date.now();
const {
- startTime = new Date().getTime(),
+ startTime = Date.now(),
maxTime = 50,
maxRetries = 50,
compare = defaultCompare,
diff --git a/test/modules/helpers.spec.ts b/test/modules/helpers.spec.ts
index 7b709373..df8f00e7 100644
--- a/test/modules/helpers.spec.ts
+++ b/test/modules/helpers.spec.ts
@@ -1292,7 +1292,7 @@ Try adjusting maxTime or maxRetries parameters for faker.helpers.unique().`)
it('should not mutate most of the input option properties', () => {
const method = () => 'options-mutate-test';
- const startTime = new Date().getTime();
+ const startTime = Date.now();
const maxTime = 49;
const maxRetries = 49;
const currentIterations = 0;