Scan your whole stack
From OX Research Newsroom
Are you using @speclynx/apidom-traverse?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v7.1.1
@speclynx/apidom-traverse was last scanned on 26 Nov 2026 at version 7.1.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 7.1.1 LATEST | 26 Nov 2026 | No rules fired |
| 7.1.0 | 19 Nov 2026 | No rules fired |
| 7.0.2 | 11 Nov 2026 | No rules fired |
| 7.0.1 | 8 Nov 2026 | Not shown |
| 7.0.0 | 8 Nov 2026 | Not shown |
Findings for v7.1.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 7.1.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
@speclynx/apidom-traverse provides traversal utilities for ApiDOM structures.
You can install this package via npm CLI by running the following command:
$ npm install @speclynx/apidom-traverse
The core traversal function that walks an ApiDOM tree using visitors.
import { ObjectElement } from '@speclynx/apidom-datamodel';
import { traverse } from '@speclynx/apidom-traverse';
const element = new ObjectElement({ a: 'b' });
traverse(element, {
enter(path) {
console.log('entering:', path.node.element);
},
leave(path) {
console.log('leaving:', path.node.element);
},
});
Async version of traverse that supports async visitors.
import { ObjectElement } from '@speclynx/apidom-datamodel';
import { traverseAsync } from '@speclynx/apidom-traverse';
const element = new ObjectElement({ a: 'b' });
await traverseAsync(element, {
async enter(path) {
await someAsyncOperation(path.node);
},
});
Both traverse and traverseAsync accept an options object as the third argument:
| Option | Type | Default | Description |
|---|---|---|---|
detectCycles |
boolean |
true |
Skip nodes that appear in the current ancestor chain (true identity cycles). |
skipVisited |
'never', 'skip' or 'enter-only' |
'never' |
Handling of nodes already visited, tracked via a WeakSet: 'skip' skips them entirely, 'enter-only' still calls the visitor on them but doesn't descend into them. Prevents combinatorial explosion when traversing dereferenced trees with shared structure (DAG from cloneShallow). |
mutable |
boolean |
false |
If true, edits modify the original tree in place. |
keyMap |
Record or function |
getNodeKeys |
Maps node types to child property names for traversal. |
nodeTypeGetter |
function |
getNodeType |
Returns the type name of a node. |
nodePredicate |
function |
isNode |
Predicate to check if a value is a valid node. |
nodeCloneFn |
function |
cloneNode |
Function to clone a node (used in immutable mode). |
mutationFn |
function |
mutateNode |
Function for applying mutations in mutable mode. |
Higher-level functions built on top of traverse for common use cases.
All operations use data-first signatures: the element comes before the predicate/options.
Finds all paths whose elements match the predicate.
import { ObjectElement, isNumberElement } from '@speclynx/apidom-datamodel';
import { filter } from '@speclynx/apidom-traverse';
const element = new ObjectElement({ a: 'b', c: 2 });
const paths = filter(element, (path) => isNumberElement(path.node)); // => [Path<NumberElement<2>>]
paths[0].node; // => NumberElement<2>
paths[0].formatPath(); // => '/c'
Finds first path whose element satisfies the provided predicate.
import { ObjectElement, isNumberElement } from '@speclynx/apidom-datamodel';
import { find } from '@speclynx/apidom-traverse';
const element = new ObjectElement({ a: 'b', c: 2 });
const path = find(element, (path) => isNumberElement(path.node)); // => Path<NumberElement<2>>
path.node; // => NumberElement<2>
path.formatPath(); // => '/c'
ApiDOM nodes can be associated with source maps. This function finds the path of the most inner node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.
import { findAtOffset } from '@speclynx/apidom-traverse';
const path = findAtOffset(elementWithSourceMaps, 3); // => Path of most inner node at offset 3
path.node; // => the element at that offset
path.formatPath(); // => JSON Pointer to the element
findAtOffset(elementWithSourceMaps, { offset: 3, includeRightBound: true });
Complement of filter. Finds all paths whose elements do NOT match the predicate.
import { ArrayElement, isNumberElement } from '@speclynx/apidom-datamodel';
import { reject } from '@speclynx/apidom-traverse';
const element = new ArrayElement([1, 'a']);
const paths = reject(element, (path) => isNumberElement(path.node)); // => [Path<ArrayElement>, Path<StringElement<'a'>>]
paths.map((p) => p.node); // => [ArrayElement, StringElement<'a'>]
Tests whether at least one path's element passes the predicate.
import { ArrayElement, isNumberElement } from '@speclynx/apidom-datamodel';
import { some } from '@speclynx/apidom-traverse';
const element = new ArrayElement([1, 'a']);
some(element, (path) => isNumberElement(path.node)); // => true
Executes the callback on this element's path and all descendant paths.
import { ArrayElement } from '@speclynx/apidom-datamodel';
import { forEach } from '@speclynx/apidom-traverse';
const element = new ArrayElement([1, 'a']);
forEach(element, (path) => console.dir(path.node)); // => prints ArrayElement, NumberElement, StringElement
The execution of the callback can be controlled further by providing a predicate.
import { ArrayElement, isNumberElement } from '@speclynx/apidom-datamodel';
import { forEach } from '@speclynx/apidom-traverse';
const element = new ArrayElement([1, 'a']);
forEach(element, {
callback: (path) => console.dir(path.node),
predicate: (path) => isNumberElement(path.node),
}); // => prints NumberElement<1>
Computes upwards edges from every child to its parent.
import { ObjectElement } from '@speclynx/apidom-datamodel';
import { parents } from '@speclynx/apidom-traverse';
const element = new ObjectElement({ key: 'value' });
const memberElement = element.getMember('key');
const { key: keyElement, value: valueElement } = memberElement;
const parentEdges = parents(element); // => WeakMap<ChildElement, ParentElement>
parentEdges.get(memberElement) === element; // => true
parentEdges.get(keyElement) === memberElement; // => true
parentEdges.get(valueElement) === memberElement; // => true
import { ArrayElement, StringElement } from '@speclynx/apidom-datamodel';
import { parents } from '@speclynx/apidom-traverse';
const itemElement1 = new StringElement('item1');
const itemElement2 = new StringElement('item2');
const element = new ArrayElement([itemElement1, itemElement2]);
const parentEdges = parents(element); // => WeakMap<ChildElement, ParentElement>
parentEdges.get(itemElement1) === element; // => true
parentEdges.get(itemElement2) === element; // => true
The Path object is passed to visitor functions and provides context about the current node.
node - The current element being visitedparent - The parent container (array or element)parentPath - The Path of the parent elementkey - The key or index in the parentindex - Numeric index if inside an array (undefined otherwise)inList - Whether the node is inside an arrayskip() - Skip visiting children of this nodestop() - Stop all traversalreplaceWith(node) - Replace the current noderemove() - Remove the current node (in mutable mode)isRoot() - Check if this is the root nodegetAncestry() - Get all ancestor pathsgetAncestorNodes() - Get all ancestor nodesgetPathKeys() - Get the path from root to current nodefindParent(predicate) - Find first parent matching predicatefind(predicate) - Find self or parent matching predicateNodes are edited only through these methods. A visitor returning a node throws an error pointing to replaceWith(); any other returned value is ignored.
Returns the element type name for use in visitors.
import { StringElement } from '@speclynx/apidom-datamodel';
import { getNodeType } from '@speclynx/apidom-traverse';
getNodeType(new StringElement('hello')); // => 'StringElement'
Merges multiple visitors into a single visitor.
import { mergeVisitors } from '@speclynx/apidom-traverse';
const visitor1 = { StringElement(path) { /* ... */ } };
const visitor2 = { NumberElement(path) { /* ... */ } };
const merged = mergeVisitors([visitor1, visitor2]); Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.