@ucanto/transport
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,2 +0,2 @@ | ||
export function encode<T>(data: T): CBOR.ByteView<T>; | ||
export function encode<T>(data: T): API.ByteView<T>; | ||
export function link<T>(bytes: API.ByteView<T>, { hasher }?: { | ||
@@ -3,0 +3,0 @@ hasher?: API.MultihashHasher; |
{ | ||
"name": "@ucanto/transport", | ||
"description": "ucanto transport", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"keywords": [ | ||
@@ -24,21 +24,19 @@ "UCAN", | ||
"dependencies": { | ||
"@ipld/car": "^4.1.5", | ||
"@ipld/car": "^4.1.6", | ||
"@ipld/dag-cbor": "^7.0.3", | ||
"@ucanto/core": "^2.0.0", | ||
"@ucanto/interface": "^2.0.0", | ||
"multiformats": "^9.8.1" | ||
"@ucanto/core": "^3.0.0", | ||
"@ucanto/interface": "^3.0.0", | ||
"multiformats": "^10.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.3.3", | ||
"@types/chai-subset": "^1.3.3", | ||
"@types/mocha": "^9.1.0", | ||
"@ucanto/principal": "^2.0.0", | ||
"@ucanto/principal": "^3.0.0", | ||
"@web-std/fetch": "^4.1.0", | ||
"c8": "^7.11.0", | ||
"chai": "^4.3.6", | ||
"chai-subset": "^1.6.0", | ||
"mocha": "^10.0.0", | ||
"mocha": "^10.1.0", | ||
"nyc": "^15.1.0", | ||
"playwright-test": "^8.1.1", | ||
"typescript": "^4.8.3" | ||
"typescript": "^4.8.4" | ||
}, | ||
@@ -92,5 +90,5 @@ "type": "module", | ||
"coverage": "c8 --reporter=html mocha test/**/*.spec.js && npm_config_yes=true npx st -d coverage -p 8080", | ||
"typecheck": "tsc --build", | ||
"check": "tsc --build", | ||
"build": "tsc --build" | ||
} | ||
} |
@@ -5,3 +5,3 @@ import * as API from '@ucanto/interface' | ||
import { sha256 } from 'multiformats/hashes/sha2' | ||
import { asLink, createLink } from '@ucanto/core' | ||
import { createLink, isLink } from '@ucanto/core' | ||
@@ -30,5 +30,4 @@ /** | ||
const cid = asLink(data) | ||
if (cid) { | ||
return cid | ||
if (isLink(data)) { | ||
return data | ||
} | ||
@@ -79,3 +78,4 @@ | ||
*/ | ||
export const encode = data => CBOR.encode(prepare(data, new Set())) | ||
export const encode = data => | ||
/** @type {CBOR.ByteView<T>} */ (CBOR.encode(prepare(data, new Set()))) | ||
@@ -82,0 +82,0 @@ /** |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10
24402
+ Added@ipld/car@5.3.3(transitive)
+ Added@ipld/dag-cbor@8.0.19.2.2(transitive)
+ Added@ipld/dag-json@9.1.1(transitive)
+ Added@ipld/dag-ucan@2.0.1(transitive)
+ Added@ucanto/core@3.0.5(transitive)
+ Added@ucanto/interface@3.0.1(transitive)
+ Addedcborg@4.2.6(transitive)
+ Addedmultiformats@10.0.311.0.213.3.1(transitive)
- Removed@ipld/dag-json@8.0.11(transitive)
- Removed@ipld/dag-ucan@4.0.0-beta(transitive)
- Removed@ucanto/core@2.0.0(transitive)
- Removed@ucanto/interface@2.0.0(transitive)
Updated@ipld/car@^4.1.6
Updated@ucanto/core@^3.0.0
Updated@ucanto/interface@^3.0.0
Updatedmultiformats@^10.0.0