Refactor Token.parent() to Token.parent, add validation tests for parent, fix parent in htmlFlow scenario, improve type saftey slightly.

This commit is contained in:
David Anson 2023-10-19 23:01:31 -07:00
parent 06466905a5
commit 2a56f130c1
9 changed files with 73 additions and 372 deletions

View file

@ -1489,7 +1489,11 @@ test("customRulesParamsAreFrozen", (t) => {
t.true(Object.isFrozen(current) || (current === params));
for (const name of Object.getOwnPropertyNames(current)) {
const value = current[name];
if (value && (typeof value === "object")) {
if (
value &&
(typeof value === "object") &&
(name !== "parent")
) {
pending.push(value);
}
}