@ceramicnetwork/streamid
Advanced tools
Comparing version 1.0.0-rc.2 to 1.0.0-rc.3
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.0.0-rc.3](/compare/@ceramicnetwork/streamid@1.0.0-rc.2...@ceramicnetwork/streamid@1.0.0-rc.3) (2021-04-29) | ||
### Features | ||
* Get instance comparison by hand (#1332) 8dbdc1b, closes #1332 | ||
# [1.0.0-rc.2](/compare/@ceramicnetwork/streamid@1.0.0-rc.1...@ceramicnetwork/streamid@1.0.0-rc.2) (2021-04-20) | ||
@@ -8,0 +19,0 @@ |
@@ -11,3 +11,3 @@ import CID from 'cids'; | ||
static fromString: typeof fromString; | ||
static [Symbol.hasInstance](instance: any): boolean; | ||
static isInstance(instance: any): instance is CommitID; | ||
constructor(type: string | number, cid: CID | string, commit?: CID | string | number); | ||
@@ -14,0 +14,0 @@ get baseID(): StreamID; |
@@ -110,3 +110,3 @@ "use strict"; | ||
} | ||
static [(_type = new WeakMap(), _cid = new WeakMap(), _commit = new WeakMap(), Symbol.hasInstance)](instance) { | ||
static isInstance(instance) { | ||
return typeof instance === 'object' && '_tag' in instance && instance._tag === TAG; | ||
@@ -148,3 +148,3 @@ } | ||
} | ||
[Symbol.for('nodejs.util.inspect.custom')]() { | ||
[(_type = new WeakMap(), _cid = new WeakMap(), _commit = new WeakMap(), Symbol.for('nodejs.util.inspect.custom'))]() { | ||
return `CommitID(${this.toString()})`; | ||
@@ -151,0 +151,0 @@ } |
@@ -11,3 +11,3 @@ import CID from 'cids'; | ||
static fromString: typeof fromString; | ||
static [Symbol.hasInstance](instance: any): boolean; | ||
static isInstance(instance: any): instance is StreamID; | ||
constructor(type: string | number, cid: CID | string); | ||
@@ -14,0 +14,0 @@ get type(): number; |
@@ -70,3 +70,3 @@ "use strict"; | ||
} | ||
static [(_type = new WeakMap(), _cid = new WeakMap(), Symbol.hasInstance)](instance) { | ||
static isInstance(instance) { | ||
return typeof instance === 'object' && '_tag' in instance && instance._tag === TAG; | ||
@@ -95,3 +95,3 @@ } | ||
equals(other) { | ||
if (other instanceof StreamID) { | ||
if (StreamID.isInstance(other)) { | ||
return this.type === other.type && this.cid.equals(other.cid); | ||
@@ -109,3 +109,3 @@ } | ||
} | ||
[Symbol.for('nodejs.util.inspect.custom')]() { | ||
[(_type = new WeakMap(), _cid = new WeakMap(), Symbol.for('nodejs.util.inspect.custom'))]() { | ||
return `StreamID(${this.toString()})`; | ||
@@ -112,0 +112,0 @@ } |
@@ -40,6 +40,6 @@ "use strict"; | ||
function from(input) { | ||
if (input instanceof stream_id_1.StreamID) { | ||
if (stream_id_1.StreamID.isInstance(input)) { | ||
return input; | ||
} | ||
else if (input instanceof commit_id_1.CommitID) { | ||
else if (commit_id_1.CommitID.isInstance(input)) { | ||
return input; | ||
@@ -46,0 +46,0 @@ } |
{ | ||
"name": "@ceramicnetwork/streamid", | ||
"version": "1.0.0-rc.2", | ||
"version": "1.0.0-rc.3", | ||
"description": "Ceramic Stream Ids", | ||
@@ -37,3 +37,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "1bdd745e4a62ddc71405ddb37cab07d88c71ca17" | ||
"gitHead": "0272aa7ff61d372a510bbb0535bc68bb88c865d0" | ||
} |
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 not supported yet
Sorry, the diff of this file is not supported yet
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
51023