@@ -4,8 +4,7 @@ export type RecordKey = string | number | symbol;
4
4
5
5
/**
6
6
* Global store of unique values.
7
- * Uniqueness for entire faker instance.
8
- * This means that faker should *never* return duplicate values across all API methods when using `Faker.unique` without passing `options.store`.
7
+ * This means that faker should *never* return duplicate values across all API methods when using `Faker.unique`.
9
8
*/
10
9
const GLOBAL_UNIQUE_STORE : Record < RecordKey , RecordKey > = { } ;
11
10
@@ -72,10 +71,10 @@ Try adjusting maxTime or maxRetries parameters for faker.unique().`
72
71
* @param method The method used to generate the values.
73
72
* @param args The arguments used to call the method.
74
73
* @param options The optional options used to configure this method.
75
- * @param options.startTime The time this execution stared. This will be ignored/overwritten. Defaults to `new Date().getTime()`.
74
+ * @param options.startTime The time this execution stared. Defaults to `new Date().getTime()`.
76
75
* @param options.maxTime The time in milliseconds this method may take before throwing an error. Defaults to `50`.
77
76
* @param options.maxRetries The total number of attempts to try before throwing an error. Defaults to `50`.
78
- * @param options.currentIterations The current attempt. This will be ignored/overwritten. Defaults to `0`.
77
+ * @param options.currentIterations The current attempt. Defaults to `0`.
79
78
* @param options.exclude The value or values that should be excluded/skipped. Defaults to `[]`.
80
79
* @param options.compare The function used to determine whether a value was already returned. Defaults to check the existence of the key.
81
80
*/
@@ -134,6 +133,13 @@ export function exec<Method extends (...parameters) => RecordKey>(
134
133
} else {
135
134
// console.log('conflict', result);
136
135
options . currentIterations ++ ;
137
- return exec ( method , args , options ) ;
136
+ return exec ( method , args , {
137
+ ...options ,
138
+ startTime,
139
+ maxTime,
140
+ maxRetries,
141
+ compare,
142
+ exclude,
143
+ } ) ;
138
144
}
139
145
}
0 commit comments