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

@ipld/codec-interface

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ipld/codec-interface - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

3

index.js

@@ -90,2 +90,5 @@ 'use strict'

async reader (block) {
// Skip a decoding if the source is available.
if (block.source && block.source()) return new Reader(block.source())
// Full decoding is required for the standard Reader interface
let decoded = await block.decode()

@@ -92,0 +95,0 @@ return new Reader(decoded)

4

package.json
{
"name": "@ipld/codec-interface",
"version": "1.0.3",
"version": "1.0.4",
"description": "Codec interface for IPLD.",

@@ -10,3 +10,3 @@ "main": "index.js",

"scripts": {
"test": "nyc --branches 100 --functions 100 --lines 100 aegir test -t node",
"test": "nyc --check-coverage --branches=100 --functions=100 --lines=100 --statements=100 aegir test",
"pretest": "aegir lint"

@@ -13,0 +13,0 @@ },

@@ -46,8 +46,10 @@ # Install

### Reader.get(path)
### Reader.get(path
### Reader.links()
Returns a generator of all the links in the block.
### Reader.tree()
'use strict'
/* globals it */
const _codec = require('../')
const CID = require('cids')
const { it } = require('mocha')
const assert = require('assert')

@@ -6,0 +6,0 @@ const tsame = require('tsame')

'use strict'
/* globals it */
const { CodecInterface } = require('../')
const CID = require('cids')
const { it } = require('mocha')
const assert = require('assert')

@@ -36,2 +36,11 @@ const tsame = require('tsame')

test('source optimization', async () => {
let reader = await mock.reader({ source: () => fixture })
let one = reader.get('/a/1').value
same(one, 1)
reader = await mock.reader({ source: () => null, decode: () => fixture })
one = reader.get('/a/1').value
same(one, 1)
})
test('links', async () => {

@@ -38,0 +47,0 @@ let reader = await getReader()

Sorry, the diff of this file is not supported yet

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