Babel plugin that transforms eval() calls containing string literals by parsing and compiling the string content at transform time
Overall
score
98%
Build an email validation library that leverages modern regular expression features to handle international email addresses and extract meaningful information from them.
Your task is to implement an email validator that:
The validator should handle:
@generates
/**
* Validates an email address supporting international Unicode characters.
*
* @param {string} email - The email address to validate
* @returns {boolean} True if the email is valid, false otherwise
*/
function validateEmail(email) {
// IMPLEMENTATION HERE
}
/**
* Extracts the username and domain parts from a valid email address.
*
* @param {string} email - The email address to parse
* @returns {Object|null} An object with 'username' and 'domain' properties, or null if invalid
*/
function extractEmailParts(email) {
// IMPLEMENTATION HERE
}
module.exports = {
validateEmail,
extractEmailParts
};Provides the core Babel transformation API for compiling modern JavaScript features including advanced regular expressions.
Install with Tessl CLI
npx tessl i tessl/npm-babel-plugin-transform-evaldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10