fix init
This commit is contained in:
parent
e67b698cbd
commit
e52f1dc4b2
@ -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(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user