mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 16:43:56 +03:00
11 lines
255 B
JavaScript
11 lines
255 B
JavaScript
import { jsxToJson } from "jsx-to-json";
|
|
import stringify from "stringify-object";
|
|
|
|
export function transform(code) {
|
|
try {
|
|
return { value: stringify(eval(jsxToJson(code))), code: 1 };
|
|
} catch (e) {
|
|
return { value: e.message, code: 0 };
|
|
}
|
|
}
|