@leofcoin/codec-format-interface 1.2.6 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -7
- package/package.json +1 -1
- package/src/index.js +11 -5
- /package/test/{test.js → index.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var isHex__default = /*#__PURE__*/_interopDefaultLegacy(isHex);
|
|
|
34
34
|
var varint__default = /*#__PURE__*/_interopDefaultLegacy(varint);
|
|
35
35
|
var createKeccakHash__default = /*#__PURE__*/_interopDefaultLegacy(createKeccakHash);
|
|
36
36
|
|
|
37
|
-
class BasicInterface {
|
|
37
|
+
class BasicInterface$1 {
|
|
38
38
|
#handleDecode() {
|
|
39
39
|
if (!this.decode) throw new Error('bad implementation: needs decode func')
|
|
40
40
|
return this.decode()
|
|
@@ -242,7 +242,7 @@ var codecs = {
|
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
-
class PeernetCodec extends BasicInterface {
|
|
245
|
+
class PeernetCodec extends BasicInterface$1 {
|
|
246
246
|
get codecs() {
|
|
247
247
|
return {...globalThis.peernet.codecs, ...codecs}
|
|
248
248
|
}
|
|
@@ -333,7 +333,7 @@ class PeernetCodec extends BasicInterface {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
class CodecHash extends BasicInterface {
|
|
336
|
+
class CodecHash$1 extends BasicInterface$1 {
|
|
337
337
|
constructor(buffer, options = {}) {
|
|
338
338
|
super();
|
|
339
339
|
if (options.name) this.name = options.name;
|
|
@@ -458,7 +458,7 @@ class CodecHash extends BasicInterface {
|
|
|
458
458
|
|
|
459
459
|
let protons;
|
|
460
460
|
|
|
461
|
-
class FormatInterface extends BasicInterface {
|
|
461
|
+
class FormatInterface$1 extends BasicInterface$1 {
|
|
462
462
|
async #importProtons() {
|
|
463
463
|
let importee = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackChunkName: "protons" */ 'protons')); });
|
|
464
464
|
return importee.default
|
|
@@ -506,7 +506,7 @@ class FormatInterface extends BasicInterface {
|
|
|
506
506
|
* @return {PeernetHash}
|
|
507
507
|
*/
|
|
508
508
|
get peernetHash() {
|
|
509
|
-
return new CodecHash(this.decoded, {name: this.name})
|
|
509
|
+
return new CodecHash$1(this.decoded, {name: this.name})
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
/**
|
|
@@ -565,8 +565,14 @@ class FormatInterface extends BasicInterface {
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
|
|
568
|
+
const BasicInterface = BasicInterface$1;
|
|
569
|
+
const FormatInterface = FormatInterface$1;
|
|
570
|
+
const CodecHash = CodecHash$1;
|
|
571
|
+
const Codec = PeernetCodec;
|
|
572
|
+
const Codecs = codecs;
|
|
573
|
+
|
|
568
574
|
exports.BasicInterface = BasicInterface;
|
|
569
|
-
exports.Codec =
|
|
575
|
+
exports.Codec = Codec;
|
|
570
576
|
exports.CodecHash = CodecHash;
|
|
577
|
+
exports.Codecs = Codecs;
|
|
571
578
|
exports.FormatInterface = FormatInterface;
|
|
572
|
-
exports.codecs = codecs;
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import basicInterface from './basic-interface.js'
|
|
2
|
+
import formatInterface from './codec-format-interface.js'
|
|
3
|
+
import codecHash from './codec-hash.js'
|
|
4
|
+
import codec from './codec.js'
|
|
5
|
+
import codecs from './codecs.js'
|
|
6
|
+
|
|
7
|
+
export const BasicInterface = basicInterface
|
|
8
|
+
export const FormatInterface = formatInterface
|
|
9
|
+
export const CodecHash = codecHash
|
|
10
|
+
export const Codec = codec
|
|
11
|
+
export const Codecs = codecs
|
|
File without changes
|