Files
SnowLuma/.pnpm-store/v11/files/29/68d61baa561db0b01e8b4d723406bfeb5bce309b359f01a47318f2e2fae2a69a179576b22bb188a81e3ddca651d0c144b00526ab80f79ccdb4af2207c5c901
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

23 lines
494 B
Plaintext

export default function getJSXPragmaInfo(options) {
const [base, suffix] = splitPragma(options.jsxPragma || "React.createElement");
const [fragmentBase, fragmentSuffix] = splitPragma(options.jsxFragmentPragma || "React.Fragment");
return {base, suffix, fragmentBase, fragmentSuffix};
}
function splitPragma(pragma) {
let dotIndex = pragma.indexOf(".");
if (dotIndex === -1) {
dotIndex = pragma.length;
}
return [pragma.slice(0, dotIndex), pragma.slice(dotIndex)];
}