Socket
Book a DemoInstallSign in
Socket

@ipld/path-level-one

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ipld/path-level-one

IPLD multi-block path resolver (Data Model Only)

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
3
Created
Source

IPLD Path Resolver

This library will resolve paths through links in a multi-block graph.

All functions take three arguments.

  • path - a string representing the target path: /one/two/three.
  • root - a CID or Block instance for the root node of the graph.
  • get - an async function that accepts a CID instance and returns a Block instance.

async resolve(path, root, get)

Returns the value of the target path.

async find(path, root, get)

Returns an object with the following properties:

  • value - the value from of the target path.
  • block - that block instance that contains the value.
  • path - the path to the value within the block.

blocks(path, root, get)

Returns and async iterator that yields Block instances for every block along the resolved path.

FAQs

Package last updated on 18 Aug 2020

Did you know?

Socket

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.

Install

Related posts