@leofcoin/codec-format-interface 1.6.14 → 1.6.16
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/codec-hash.d.ts +1 -1
- package/dist/index.js +4 -11
- package/package.json +1 -1
package/dist/codec-hash.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -36,11 +36,11 @@ let BasicInterface$1 = class BasicInterface {
|
|
|
36
36
|
// get Codec(): Codec {}
|
|
37
37
|
protoEncode(data) {
|
|
38
38
|
// check schema
|
|
39
|
-
return proto.encode(this.proto, data);
|
|
39
|
+
return proto.encode(this.proto, data, false);
|
|
40
40
|
}
|
|
41
41
|
protoDecode(data) {
|
|
42
42
|
// check schema
|
|
43
|
-
return proto.decode(this.proto, data);
|
|
43
|
+
return proto.decode(this.proto, data, false);
|
|
44
44
|
}
|
|
45
45
|
isHex(string) {
|
|
46
46
|
return isHex(string);
|
|
@@ -412,7 +412,7 @@ let FormatInterface$1 = class FormatInterface extends BasicInterface$1 {
|
|
|
412
412
|
* @return {PeernetHash}
|
|
413
413
|
*/
|
|
414
414
|
get peernetHash() {
|
|
415
|
-
return new CodecHash$1(this.
|
|
415
|
+
return new CodecHash$1(this.encoded, { name: this.name });
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
418
|
* @return {peernetHash}
|
|
@@ -437,14 +437,7 @@ let FormatInterface$1 = class FormatInterface extends BasicInterface$1 {
|
|
|
437
437
|
const decoded = {};
|
|
438
438
|
if (this.keys?.length > 0) {
|
|
439
439
|
for (const key of this.keys) {
|
|
440
|
-
|
|
441
|
-
[key]: {
|
|
442
|
-
enumerable: true,
|
|
443
|
-
configurable: true,
|
|
444
|
-
set: (value) => data[key],
|
|
445
|
-
get: () => data[key]
|
|
446
|
-
}
|
|
447
|
-
});
|
|
440
|
+
decoded[key] = data[key];
|
|
448
441
|
}
|
|
449
442
|
this.decoded = decoded;
|
|
450
443
|
return this.encode(decoded);
|