Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@tangle/overwrite

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tangle/overwrite

a strategy for over-writing transformations


Version published
Weekly downloads
6
decreased by-14.29%
Maintainers
3
Weekly downloads
 
Created
Source

@tangle/overwrite

see tests for examples.

API

Overwrite(opts) => overwrite

opts Object (optional) can have properties:

  • identity
    • define the identity transformation for this strategy
    • default {}
  • reifiedIdentity
    • define with reify(identity) resolves to
    • default null,
  • valueSchema Object
    • add a JSON-schema to validate the values which are allowed to be passed in
    • default (see code, allows string / object / boolean / number)

overwrite.schema

overwrite.isValid

overwrite.identity() => I

overwrite.concat(R, S) => T

overwrite.mapFromInput(currentT, input) => T

overwrite.mapToOutput(T) => t

overwrite.isConflict(graph, nodeIds, field) => Boolean

where:

  • graph is a @tangle/graph instance
  • nodeIds is an Array of nodeIds you're wanting to check for conflict
  • field String is the data field node.data[field] you're checking for conflicts

overwrite.isValidMerge(graph, nodeId, field) => Boolean

where:

  • graph is a @tangle/graph instance
  • nodeId is the id of the proposed merge-node
  • field String is the data field node.data[field] you're checking for merge validity

overwrite.merge(graph, nodeId, field) => T

similar to isValidMerge, but return a transformation, T If it cannot, an error is thrown!


Used with modules such as:

  • @tangle/strategy
  • ssb-crut

Keywords

FAQs

Package last updated on 26 Oct 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc