This commit is contained in:
Taso committed 2021-04-18 15:38:50 -04:00
1 parent 949ea4ba4b
commit e01fa0ab0a
16 files changed
+406 -231

No files matched your search

@@ -0,0 +1,13 @@
import { config } from '../server';
export function getRandomPhoneNumber() {
if (!config.general.useDashNumber) {
return Math.floor(Math.random() * 10000000).toString(); // 10000000 creates a number with 7 characters.
}
return Math.floor(Math.random() * 10000000)
.toString()
.replace(/(\d{3})(\d{4})/, '$1-$2');
// The numbers inside {} in replace() can be changed to how many digits you want on each side of the dash.
// Example: 123-4567
}