mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-09 21:18:40 +00:00
make 'names' accept only an array of strings, add warning comments about where new functions should be added
This commit is contained in:
committed by
Kevin Barabash
parent
6db61cb219
commit
12399da73d
@@ -3,9 +3,17 @@ import ParseError from "./ParseError";
|
||||
import ParseNode from "./ParseNode";
|
||||
import {default as _defineFunction, ordargument} from "./defineFunction";
|
||||
|
||||
// WARNING: New functions should be added to src/functions.
|
||||
|
||||
// Define a convenience function that mimcs the old semantics of defineFunction
|
||||
// to support existing code so that we can migrate it a little bit at a time.
|
||||
const defineFunction = function(names, props, handler) {
|
||||
if (typeof names === "string") {
|
||||
names = [names];
|
||||
}
|
||||
if (typeof props === "number") {
|
||||
props = { numArgs: props };
|
||||
}
|
||||
_defineFunction({names, props, handler});
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user