File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
import * as uniqueExec from './vendor/unique' ;
2
2
3
+ /**
4
+ * Module to generate unique entries.
5
+ */
3
6
export class Unique {
4
7
// maximum time unique.exec will attempt to run before aborting
5
8
maxTime = 10 ;
@@ -21,9 +24,21 @@ export class Unique {
21
24
}
22
25
23
26
/**
24
- * unique
27
+ * Generates a unique result using the results of the given method.
28
+ * Used unique entries will be stored internally and filtered from subsequent calls.
25
29
*
26
- * @method unique
30
+ * @param method The method used to generate the values.
31
+ * @param args The arguments used to call the method.
32
+ * @param opts The optional options used to configure this method.
33
+ * @param opts.startTime The time this execution stared. This will be ignored/overwritten.
34
+ * @param opts.maxTime The time this method may take before throwing an error.
35
+ * @param opts.maxRetries The total number of attempts to try before throwing an error.
36
+ * @param opts.currentIterations The current attempt. This will be ignored/overwritten.
37
+ * @param opts.exclude The value or values that should be excluded/skipped.
38
+ * @param opts.compare The function used to determine whether a value was already returned.
39
+ *
40
+ * @example
41
+ * faker.unique(faker.name.firstName())
27
42
*/
28
43
unique < Method extends ( args : Args ) => string , Args extends any [ ] > (
29
44
method : Method ,
You can’t perform that action at this time.
0 commit comments