feat(templates): add username and email generation using faker

This commit is contained in:
Mauricio Siu 2025-04-03 00:22:29 -06:00
parent b9de05015f
commit 9a839de022

View File

@ -1,3 +1,4 @@
import { faker } from "@faker-js/faker";
import type { Schema } from "./index";
import {
generateBase64,
@ -117,6 +118,14 @@ function processValue(
return generateJwt(length);
}
if (varName === "username") {
return faker.internet.userName().toLowerCase();
}
if (varName === "email") {
return faker.internet.email().toLowerCase();
}
// If not a utility function, try to get from variables
return variables[varName] || match;
});