![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@unified-latex/unified-latex-util-visit
Advanced tools
Functions to traverse a unified-latex
Abstract Syntax Tree (AST). visit
is
very similar to estree-util-visit.
If you want to recursively replace particular AST nodes.
visit(tree, visitor, options)
Visit children of tree which pass a test
function visit<Opts extends VisitOptions>(
tree: Ast.Ast,
visitor:
| Visitor<NarrowArraysBasedOnOptions<GuardFromOptions<Opts, Ast.Ast>, Opts>>
| Visitors<
NarrowArraysBasedOnOptions<GuardFromOptions<Opts, Ast.Ast>, Opts>
>,
options: VisitOptions
): void;
Parameters
Param | Type | Description |
---|---|---|
tree | Ast.Ast | Abstract syntax tree to walk |
visitor | Omitted | Function to run for each node |
options | VisitOptions | see below |
where
type VisitOptions = {
startingContext?: VisitorContext;
/**
* Type guard for types that are passed to the `visitor` function.
*/
test?: (node: Ast.Ast, info: VisitInfo) => boolean;
/**
* Whether arrays will be sent to the `visitor` function. If falsy,
* only nodes will be past to `visitor`.
*/
includeArrays?: boolean;
};
Name | Type | Description |
---|---|---|
CONTINUE | Symbol | Continue traversing as normal |
EXIT | Symbol | Stop traversing immediately |
SKIP | Symbol | Do not traverse this node’s children |
VisitInfo
export type VisitInfo = {
/**
* If the element was accessed via an attribute, the attribute key is specified.
*/
readonly key: string | undefined;
/**
* If the element was accessed in an array, the index is specified.
*/
readonly index: number | undefined;
/**
* A list of ancestor nodes, `[parent, grandparent, great-grandparent, ...]`
*/
readonly parents: (Ast.Node | Ast.Argument)[];
/**
* If the element was accessed in an array, the array that it is part of.
*/
readonly containingArray: (Ast.Node | Ast.Argument)[] | undefined;
/**
* The LaTeX context of the current match.
*/
readonly context: VisitorContext;
};
VisitorContext
export type VisitorContext = {
/**
* Whether the node is being processed in math mode.
*
* This happens when the node is a director or indirect child
* of a math environment (e.g. `$abc$`), but not when an environment
* re-establishes text mode (e.g. `$\text{abc}$`)
*/
inMathMode?: boolean;
/**
* Whether the node has any ancestor that is processed in math mode.
*/
hasMathModeAncestor?: boolean;
};
FAQs
Functions for traversing a unified-latex AST
The npm package @unified-latex/unified-latex-util-visit receives a total of 1,529 weekly downloads. As such, @unified-latex/unified-latex-util-visit popularity was classified as popular.
We found that @unified-latex/unified-latex-util-visit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.