@inlang/paraglide-js
Version:
[](https://www.npmjs.com/package/@inlang/paraglide-js) [;
* >> code === "const myVar = 'Hello';"
*/
export function compileLocalVariable(args) {
const annotation = args.declaration.value.annotation;
const value = compileAnnotation(compileLiteralOrVarRef(args.declaration.value.arg), args.locale, annotation);
return `const ${args.declaration.name} = ${value};`;
}
function compileLiteralOrVarRef(value) {
switch (value.type) {
case "literal":
return `"${escapeForDoubleQuoteString(value.value)}"`;
case "variable-reference":
return compileInputAccess(value.name);
}
}
//# sourceMappingURL=compile-local-variable.js.map