Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@rdfjs/traverser
Advanced tools
This package provides a generic traverser for RDF/JS Datasets.
The main export of the package is the Traverser
class.
It can be imported like this:
import Traverser from '@rdfjs/traverser'
The package also provides a factory that can be used with @rdfjs/environment:
import Environment from '@rdfjs/environment'
import TraverserFactory from '@rdfjs/traverser/Factory.js'
const env = new Environment([DataFactory, DatasetFactory, TraverserFactory])
Creates a new Traverser
instance.
A Traverser
contains only the rules for traversing.
The dataset and the starting point must be given to the methods.
filter
: A filter function that returns a truthy value if the Traverser
should traverse the given quad.backward
: If true, traverse from object to subject. (default: false
)factory
: A RDF/JS factory that supports RDF/JS Datasets.
The function will be called like this: filter({ dataset, level, quad })
.
dataset
: The RDF/JS Dataset that is traversed.level
: The number of quads followed until the filter was called.quad
: The current quad to process.forward
: (default: true
)Calls the given callback function for each quad matching the rules of the Traverser
, starting from the given term
and dataset
.
The callback function is called like this: callback({ dataset, level, quad })
.
dataset
: The RDF/JS Dataset that is traversed.level
: The number of quads followed until the callback was called.quad
: The current quad to process.Returns a RDF/JS Dataset that contains all quads matching the rules of the Traverser
, starting from the given term
and dataset
.
Calls the given callback function for each quad matching the rules of the Traverser
, starting from the given term
and dataset
.
The callback function is called like this: callback({ dataset, level, quad }, result)
.
dataset
: The RDF/JS Dataset that is traversed.level
: The number of quads followed until the callback was called.quad
: The current quad to process.result
: The return value of the previous call of the callback function.
If it's called the first time, the initialValue
is used.The constructor is called by the @rdfjs/environment. The environment must support the RDF/JS DatasetFactory interface.
Creates a new Traverser
instance and returns it.
For more details, see the Traverser constructor section.
FAQs
Generic traverser for RDF/JS datasets
We found that @rdfjs/traverser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.