Minor refactor (#15617)
This commit is contained in:
1 parent
0176a33db4
commit
cd7931f479
2 files changed
+11
-8
No files matched your search
@@ -1,4 +1,4 @@
|
||||
const DEFAULT_ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS = {
|
||||
const ANGULAR_CONTROL_FLOW_BLOCK_DEFAULT_SETTINGS = {
|
||||
isFollowingBlock: false,
|
||||
followingBlocks: new Set(),
|
||||
};
|
||||
@@ -50,16 +50,16 @@ const ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS = new Map(
|
||||
].map((settings) => [
|
||||
settings.name,
|
||||
{
|
||||
DEFAULT_ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS,
|
||||
ANGULAR_CONTROL_FLOW_BLOCK_DEFAULT_SETTINGS,
|
||||
...settings,
|
||||
followingBlocks: settings.followingBlocks
|
||||
? new Set(settings.followingBlocks)
|
||||
: DEFAULT_ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS.followingBlocks,
|
||||
: ANGULAR_CONTROL_FLOW_BLOCK_DEFAULT_SETTINGS.followingBlocks,
|
||||
},
|
||||
]),
|
||||
);
|
||||
|
||||
export default {
|
||||
DEFAULT_ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS,
|
||||
export {
|
||||
ANGULAR_CONTROL_FLOW_BLOCK_DEFAULT_SETTINGS,
|
||||
ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS,
|
||||
};
|
||||
+6
-3
@@ -7,15 +7,18 @@ import {
|
||||
join,
|
||||
} from "../../document/builders.js";
|
||||
import { printChildren } from "./children.js";
|
||||
import settings from "./angular-control-flow-block-settings.evaluate.js";
|
||||
import {
|
||||
ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS,
|
||||
ANGULAR_CONTROL_FLOW_BLOCK_DEFAULT_SETTINGS,
|
||||
} from "./angular-control-flow-block-settings.evaluate.js";
|
||||
|
||||
const unClosedBlocks = new WeakSet();
|
||||
|
||||
function printAngularControlFlowBlock(path, options, print) {
|
||||
const { node } = path;
|
||||
const setting =
|
||||
settings.ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS.get(node.name) ??
|
||||
settings.DEFAULT_ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS;
|
||||
ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS.get(node.name) ??
|
||||
ANGULAR_CONTROL_FLOW_BLOCK_DEFAULT_SETTINGS;
|
||||
const docs = [];
|
||||
|
||||
const previousBlock = findPreviousBlock(path);
|
||||
|
||||
Reference in new issue
Block a user