Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chainsafe/ssz

Package Overview
Dependencies
Maintainers
3
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainsafe/ssz - npm Package Compare versions

Comparing version 0.8.5 to 0.8.6

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 0.8.5 (2021-05-25)
## Bug Fixes
- Fix basic vector struct_convertFromJson ([05e7c2](https://github.com/chainsafe/ssz/commit/05e7c2))
## 0.8.5 (2021-05-19)

@@ -2,0 +8,0 @@

9

lib/backings/index.js

@@ -11,5 +11,6 @@ "use strict";

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _tree[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _tree[key];

@@ -24,5 +25,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _backedValue[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _backedValue[key];

@@ -37,5 +39,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _readonlyIterate[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _readonlyIterate[key];

@@ -42,0 +45,0 @@ }

@@ -11,5 +11,6 @@ "use strict";

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _interface[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _interface[key];

@@ -24,5 +25,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _treeValue[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _treeValue[key];

@@ -29,0 +31,0 @@ }

@@ -11,3 +11,3 @@ "use strict";

enumerable: true,
get: function get() {
get: function () {
return _compat.hash;

@@ -22,5 +22,6 @@ }

if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _interface[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _interface[key];

@@ -36,5 +37,6 @@ }

if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _types[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _types[key];

@@ -50,5 +52,6 @@ }

if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _backings[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _backings[key];

@@ -66,5 +69,6 @@ }

if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _byteArray[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _byteArray[key];

@@ -80,5 +84,6 @@ }

if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _tree[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _tree[key];

@@ -85,0 +90,0 @@ }

@@ -76,3 +76,3 @@ "use strict";

if (length < this.struct_getSerializedLength()) {
throw new Error("Data length of ".concat(length, " is too small, expect ").concat(this.struct_getSerializedLength()));
throw new Error(`Data length of ${length} is too small, expect ${this.struct_getSerializedLength()}`);
} // accept data length > this.size()

@@ -79,0 +79,0 @@

@@ -11,5 +11,6 @@ "use strict";

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _abstract[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _abstract[key];

@@ -24,5 +25,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _boolean[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _boolean[key];

@@ -37,5 +39,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _uint[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _uint[key];

@@ -50,5 +53,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _wellKnown[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _wellKnown[key];

@@ -55,0 +59,0 @@ }

@@ -86,15 +86,15 @@ "use strict";

if (start < 0) {
throw new Error("Start param is negative: ".concat(start));
throw new Error(`Start param is negative: ${start}`);
}
if (start > data.length) {
throw new Error("Start param: ".concat(start, " is greater than length: ").concat(data.length));
throw new Error(`Start param: ${start} is greater than length: ${data.length}`);
}
if (end < 0) {
throw new Error("End param is negative: ".concat(end));
throw new Error(`End param is negative: ${end}`);
}
if (end > data.length) {
throw new Error("End param: ".concat(end, " is greater than length: ").concat(data.length));
throw new Error(`End param: ${end} is greater than length: ${data.length}`);
}

@@ -105,7 +105,7 @@

if (!this.hasVariableSerializedLength() && length !== this.struct_getSerializedLength(null)) {
throw new Error("Incorrect data length ".concat(length, ", expect ").concat(this.struct_getSerializedLength(null)));
throw new Error(`Incorrect data length ${length}, expect ${this.struct_getSerializedLength(null)}`);
}
if (end - start < this.getMinSerializedLength()) {
throw new Error("Data length ".concat(length, " is too small, expect at least ").concat(this.getMinSerializedLength()));
throw new Error(`Data length ${length} is too small, expect at least ${this.getMinSerializedLength()}`);
}

@@ -112,0 +112,0 @@ }

@@ -44,3 +44,3 @@ "use strict";

} catch (e) {
throw new Error("Invalid element ".concat(i, ": ").concat(e.message));
throw new Error(`Invalid element ${i}: ${e.message}`);
}

@@ -357,3 +357,3 @@ }

} catch (e) {
throw new Error("Invalid element ".concat(i, ": ").concat(e.message));
throw new Error(`Invalid element ${i}: ${e.message}`);
}

@@ -360,0 +360,0 @@ }

@@ -17,3 +17,3 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -20,0 +20,0 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

@@ -17,3 +17,3 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -20,0 +20,0 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

@@ -17,3 +17,3 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -49,3 +49,3 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

if (length !== this.length) {
throw new Error("Invalid deserialized vector length: expected ".concat(this.length, ", actual: ").concat(length));
throw new Error(`Invalid deserialized vector length: expected ${this.length}, actual: ${length}`);
}

@@ -67,3 +67,3 @@

if (value.length !== this.length) {
throw new Error("Invalid JSON vector length: expected ".concat(this.length, ", actual: ").concat(value.length));
throw new Error(`Invalid JSON vector length: expected ${this.length}, actual: ${value.length}`);
}

@@ -70,0 +70,0 @@

@@ -21,3 +21,3 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

@@ -90,3 +90,3 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

} catch (e) {
throw new Error("Invalid field ".concat(fieldName, ": ").concat(e.message));
throw new Error(`Invalid field ${fieldName}: ${e.message}`);
}

@@ -225,3 +225,3 @@ }

if (data[expectedFieldName] === undefined) {
throw new Error("Invalid JSON container field: expected field ".concat(expectedFieldName, " is undefined"));
throw new Error(`Invalid JSON container field: expected field ${expectedFieldName} is undefined`);
}

@@ -412,3 +412,3 @@

if (chunkIndex === -1) {
throw new Error("Invalid container field name: ".concat(String(prop)));
throw new Error(`Invalid container field name: ${String(prop)}`);
}

@@ -423,3 +423,3 @@

if (!type) {
throw new Error("Invalid container field name: ".concat(String(prop)));
throw new Error(`Invalid container field name: ${String(prop)}`);
}

@@ -426,0 +426,0 @@

@@ -11,5 +11,6 @@ "use strict";

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _abstract[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _abstract[key];

@@ -24,5 +25,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _array[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _array[key];

@@ -37,5 +39,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _vector[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _vector[key];

@@ -50,5 +53,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _list[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _list[key];

@@ -63,5 +67,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _bitVector[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _bitVector[key];

@@ -76,5 +81,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _bitList[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _bitList[key];

@@ -89,5 +95,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _byteVector[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _byteVector[key];

@@ -102,5 +109,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _root[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _root[key];

@@ -115,5 +123,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _container[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _container[key];

@@ -120,0 +129,0 @@ }

@@ -111,3 +111,3 @@ "use strict";

if (data.length > maxLength) {
throw new Error("Invalid JSON list: length ".concat(data.length, " greater than limit ").concat(maxLength));
throw new Error(`Invalid JSON list: length ${data.length} greater than limit ${maxLength}`);
}

@@ -286,3 +286,3 @@

if (value.length > this.limit) {
throw new Error("Deserialized list length greater than limit: ".concat(value.length, " ").concat(this.limit));
throw new Error(`Deserialized list length greater than limit: ${value.length} ${this.limit}`);
}

@@ -309,3 +309,3 @@

if (data.length > maxLength) {
throw new Error("Invalid JSON list: length ".concat(data.length, " greater than limit ").concat(maxLength));
throw new Error(`Invalid JSON list: length ${data.length} greater than limit ${maxLength}`);
}

@@ -312,0 +312,0 @@

@@ -90,3 +90,3 @@ "use strict";

if (actualLength !== expectedLength) {
throw new Error("Invalid vector length: expected ".concat(expectedLength, ", actual ").concat(actualLength));
throw new Error(`Invalid vector length: expected ${expectedLength}, actual ${actualLength}`);
}

@@ -105,6 +105,6 @@

if (data.length !== expectedLength) {
throw new Error("Invalid JSON vector length: expected ".concat(expectedLength, ", actual ").concat(data.length));
throw new Error(`Invalid JSON vector length: expected ${expectedLength}, actual ${data.length}`);
}
return super.fromJson(data);
return super.struct_convertFromJson(data);
}

@@ -205,3 +205,3 @@

if (actualLength !== expectedLength) {
throw new Error("Invalid vector length: expected ".concat(expectedLength, ", actual ").concat(actualLength));
throw new Error(`Invalid vector length: expected ${expectedLength}, actual ${actualLength}`);
}

@@ -220,3 +220,3 @@

if (data.length !== expectedLength) {
throw new Error("Invalid JSON vector length: expected ".concat(expectedLength, ", actual ").concat(data.length));
throw new Error(`Invalid JSON vector length: expected ${expectedLength}, actual ${data.length}`);
}

@@ -223,0 +223,0 @@

@@ -11,5 +11,6 @@ "use strict";

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _basic[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _basic[key];

@@ -24,5 +25,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _composite[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _composite[key];

@@ -37,5 +39,6 @@ }

if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _type[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
get: function () {
return _type[key];

@@ -42,0 +45,0 @@ }

@@ -19,3 +19,3 @@ "use strict";

const rawMessage = e instanceof SszErrorPath ? e.rawMessage : e.message;
super("".concat(renderJsonPath(jsonPath), ": ").concat(rawMessage));
super(`${renderJsonPath(jsonPath)}: ${rawMessage}`);

@@ -46,3 +46,3 @@ _defineProperty(this, "jsonPath", void 0);

case "number":
path += "[".concat(item, "]");
path += `[${item}]`;
break;

@@ -52,3 +52,3 @@

default:
path += path.length > 0 ? ".".concat(item) : item;
path += path.length > 0 ? `.${item}` : item;
break;

@@ -55,0 +55,0 @@ }

@@ -5,5 +5,5 @@ "use strict";

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

@@ -10,0 +10,0 @@ /** @module ssz */

@@ -7,3 +7,3 @@ {

"homepage": "https://github.com/chainsafe/ssz",
"version": "0.8.5",
"version": "0.8.6",
"main": "lib/index.js",

@@ -10,0 +10,0 @@ "files": [

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

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc