Skip to content

Commit 633473c

Browse files
committed
Add documentation to Config Interface parameters
I took the same texts used in the README to add more documentation inside the code
1 parent f5bc912 commit 633473c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/generateUniqueID.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@ const CUSTOM_EPOCH = 1546300800000; // 01-01-2019
66
const MAX_MACHINE_ID = (1 << 12) - 1;
77

88
interface Config {
9+
/**
10+
* Defaults to 1546300800000 (01-01-2019). This is UNIX timestamp in ms
11+
*/
912
customEpoch?: number;
13+
/**
14+
* Defaults to false. If set to true, the returned ids will be of type BigInt or else of type string
15+
*/
1016
returnNumber?: boolean;
17+
/**
18+
* A value ranging between 0 - 4095. If not provided then a random value will be used
19+
*/
1120
machineID?: number;
1221
}
1322

0 commit comments

Comments
 (0)