Comparing version 0.5.2 to 0.5.3
@@ -0,1 +1,11 @@ | ||
<a name="0.5.3"></a> | ||
## [0.5.3](https://github.com/ipld/js-cid/compare/v0.5.2...v0.5.3) (2018-03-12) | ||
### Bug Fixes | ||
* [#39](https://github.com/ipld/js-cid/issues/39) - Improve constructor performance ([#45](https://github.com/ipld/js-cid/issues/45)) ([dc0bfd3](https://github.com/ipld/js-cid/commit/dc0bfd3)) | ||
<a name="0.5.2"></a> | ||
@@ -2,0 +12,0 @@ ## [0.5.2](https://github.com/ipld/js-cid/compare/v0.5.1...v0.5.2) (2017-10-06) |
{ | ||
"name": "cids", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "CID Implementation in JavaScript", | ||
@@ -38,11 +38,12 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"multibase": "~0.3.4", | ||
"multicodec": "~0.2.3", | ||
"multihashes": "~0.4.9" | ||
"multibase": "~0.4.0", | ||
"multicodec": "~0.2.6", | ||
"multihashes": "~0.4.13" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^12.0.8", | ||
"aegir": "^13.0.6", | ||
"chai": "^4.1.2", | ||
"dirty-chai": "^2.0.1", | ||
"multihashing-async": "~0.4.6", | ||
"multihashing": "^0.3.2", | ||
"multihashing-async": "^0.4.8", | ||
"pre-commit": "^1.2.2" | ||
@@ -59,3 +60,6 @@ }, | ||
"Mitar <mitar.github@tnode.com>", | ||
"Real Harry <sidewaybot@gmail.com>", | ||
"Richard Littauer <richard.littauer@gmail.com>", | ||
"Victor Bjelkholm <victorbjelkholm@gmail.com>", | ||
"Volker Mische <volker.mische@gmail.com>", | ||
"greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>", | ||
@@ -62,0 +66,0 @@ "kumavis <kumavis@users.noreply.github.com>" |
@@ -24,11 +24,2 @@ # js-cid | ||
- [API](#api) | ||
- [`new CID(version, codec, hash])`](#new-cidcodec-version-hash) | ||
- [`.codec`](#codec) | ||
- [`.version`](#version) | ||
- [`.multihash`](#multihash) | ||
- [`.buffer`](#buffer) | ||
- [`.toBaseEncodedString(base)`](#tostring) | ||
- [`.toJSON()`](#tojson) | ||
- [`CID.isCID(other)`](#cidiscidother) | ||
- [`CID.codecs`](#cidcodecs) | ||
- [Contribute](#contribute) | ||
@@ -35,0 +26,0 @@ - [License](#license) |
@@ -9,2 +9,3 @@ 'use strict' | ||
const multihash = require('multihashes') | ||
const CIDUtil = require('./cid-util') | ||
@@ -222,9 +223,3 @@ /** | ||
static isCID (other) { | ||
try { | ||
CID.validateCID(other) | ||
} catch (err) { | ||
return false | ||
} | ||
return true | ||
return !(CIDUtil.checkCIDComponents(other)) | ||
} | ||
@@ -240,19 +235,6 @@ | ||
static validateCID (other) { | ||
if (other == null) { | ||
throw new Error('null values are not valid CIDs') | ||
let errorMsg = CIDUtil.checkCIDComponents(other) | ||
if (errorMsg) { | ||
throw new Error(errorMsg) | ||
} | ||
if (!(other.version === 0 || other.version === 1)) { | ||
throw new Error('Invalid version, must be a number equal to 1 or 0') | ||
} | ||
if (typeof other.codec !== 'string') { | ||
throw new Error('codec must be string') | ||
} | ||
if (!Buffer.isBuffer(other.multihash)) { | ||
throw new Error('multihash must be a Buffer') | ||
} | ||
mh.validate(other.multihash) | ||
} | ||
@@ -259,0 +241,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
434423
15
4629
6
86
+ Addedbase-x@3.0.4(transitive)
+ Addedmultibase@0.4.0(transitive)
- Removedbase-x@3.0.0(transitive)
- Removedmultibase@0.3.4(transitive)
Updatedmultibase@~0.4.0
Updatedmulticodec@~0.2.6
Updatedmultihashes@~0.4.13