This commit is contained in:
Huáng Jùnliàng 2022-01-14 18:53:29 -05:00 committed by Nicolò Ribaudo
parent e67b698cbd
commit e52f1dc4b2

View File

@ -16,6 +16,7 @@ export default declare((api, options) => {
if (typeof legacy !== "boolean") { if (typeof legacy !== "boolean") {
throw new Error("'legacy' must be a boolean."); throw new Error("'legacy' must be a boolean.");
} }
const { decoratorsBeforeExport, version } = options;
if (version !== undefined && options.legacy !== undefined) { if (version !== undefined && options.legacy !== undefined) {
throw new Error( throw new Error(
'You can either specify `legacy: true` or `version: "legacy"` with decorators, not both.', 'You can either specify `legacy: true` or `version: "legacy"` with decorators, not both.',
@ -23,7 +24,6 @@ export default declare((api, options) => {
} }
legacy ||= version === "legacy"; legacy ||= version === "legacy";
const { decoratorsBeforeExport, version } = options;
if (decoratorsBeforeExport === undefined) { if (decoratorsBeforeExport === undefined) {
if (!legacy) { if (!legacy) {
throw new Error( throw new Error(