mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-22 10:58:40 +00:00
Remove checkNodeType and assert/checkAtomFamily (#2137)
We used functions with $FlowFixMe as Flow couldn't refine ParseNode using its type. It seems the issue has been fixed and complicated function calls can be removed.
This commit is contained in:
committed by
Kevin Barabash
parent
981a9ea3a0
commit
fa8fbc0c18
@@ -1,6 +1,4 @@
|
||||
// @flow
|
||||
import {checkNodeType} from "./parseNode";
|
||||
|
||||
import type Parser from "./Parser";
|
||||
import type {ParseNode, AnyParseNode, NodeType, UnsupportedCmdParseNode}
|
||||
from "./parseNode";
|
||||
@@ -228,6 +226,5 @@ export function defineFunctionBuilders<NODETYPE: NodeType>({
|
||||
// Since the corresponding buildHTML/buildMathML function expects a
|
||||
// list of elements, we normalize for different kinds of arguments
|
||||
export const ordargument = function(arg: AnyParseNode): AnyParseNode[] {
|
||||
const node = checkNodeType(arg, "ordgroup");
|
||||
return node ? node.body : [arg];
|
||||
return arg.type === "ordgroup" ? arg.body : [arg];
|
||||
};
|
||||
|
Reference in New Issue
Block a user