Babel plugin that compiles ES2015 unicode string and number literals to ES5
86
A utility that transforms JavaScript code containing unicode escape sequences in string literals to use the actual unicode characters.
"\u0048\u0065\u006C\u006C\u006F", returns code with "Hello" @test"\u{1F600}", returns code with the actual emoji character @test@generates
/**
* Transforms JavaScript source code to normalize unicode escape sequences in string literals.
*
* @param {string} sourceCode - The JavaScript source code to transform.
* @returns {string} The transformed code with normalized unicode characters.
* @throws {Error} If the source code has invalid syntax.
*/
function normalizeUnicode(sourceCode) {
// IMPLEMENTATION HERE
}
module.exports = {
normalizeUnicode,
};Provides unicode string literal normalization functionality for transforming ES2015 unicode escape sequences.
Provides the core Babel transformation infrastructure for parsing and generating JavaScript code.
Install with Tessl CLI
npx tessl i tessl/npm-babel-plugin-transform-es2015-literalsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10