Commit dbbc785 1 parent f5eddaa commit dbbc785 Copy full SHA for dbbc785
File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
import type { Faker } from '../..' ;
2
2
import { FakerError } from '../../errors/faker-error' ;
3
+ import { deprecated } from '../../internal/deprecated' ;
3
4
import { luhnCheckValue } from './luhn-check' ;
4
5
import type { RecordKey } from './unique' ;
5
6
import * as uniqueExec from './unique' ;
@@ -1238,10 +1239,15 @@ export class HelpersModule {
1238
1239
* @param options.compare The function used to determine whether a value was already returned. Defaults to check the existence of the key.
1239
1240
* @param options.store The store of unique entries. Defaults to a global store.
1240
1241
*
1242
+ * @see https://github.com/faker-js/faker/issues/1785#issuecomment-1407773744
1243
+ *
1241
1244
* @example
1242
1245
* faker.helpers.unique(faker.person.firstName) // 'Corbin'
1243
1246
*
1244
1247
* @since 7.5.0
1248
+ *
1249
+ * @deprecated Please find a dedicated npm package instead, or even create one on your own if you want to.
1250
+ * More info can be found in issue [faker-js/faker #1785](https://github.com/faker-js/faker/issues/1785).
1245
1251
*/
1246
1252
unique <
1247
1253
Method extends (
@@ -1299,6 +1305,14 @@ export class HelpersModule {
1299
1305
store ?: Record < RecordKey , RecordKey > ;
1300
1306
} = { }
1301
1307
) : ReturnType < Method > {
1308
+ deprecated ( {
1309
+ deprecated : 'faker.helpers.unique' ,
1310
+ proposed :
1311
+ 'https://github.com/faker-js/faker/issues/1785#issuecomment-1407773744' ,
1312
+ since : '8.0' ,
1313
+ until : '9.0' ,
1314
+ } ) ;
1315
+
1302
1316
const { maxTime = 50 , maxRetries = 50 } = options ;
1303
1317
return uniqueExec . exec ( method , args , {
1304
1318
...options ,
You can’t perform that action at this time.
0 commit comments