Socket
Socket
Sign inDemoInstall

@celo/utils

Package Overview
Dependencies
Maintainers
21
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@celo/utils - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0-alpha.1

LICENSE

6

lib/collections.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

6

lib/dappkit.js

@@ -75,6 +75,6 @@ "use strict";

if (value === undefined) {
throw new Error("Expected " + objectName + " to contain " + key);
throw new Error("Expected ".concat(objectName, " to contain ").concat(key));
}
if (typeof value !== 'string') {
throw new Error("Expected " + objectName + "[" + key + "] to be a string, but is " + typeof value);
throw new Error("Expected ".concat(objectName, "[").concat(key, "] to be a string, but is ").concat(typeof value));
}

@@ -102,3 +102,3 @@ return;

default:
throw new Error("Invalid DappKitRequest type: " + JSON.stringify(request));
throw new Error("Invalid DappKitRequest type: ".concat(JSON.stringify(request)));
}

@@ -105,0 +105,0 @@ return exports.DAPPKIT_BASE_HOST + '?' + (0, querystring_1.stringify)(params);

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

if (noLeading0x.length === 128) {
return "04" + noLeading0x;
return "04".concat(noLeading0x);
}

@@ -56,0 +56,0 @@ return noLeading0x;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -58,3 +62,3 @@ if (k2 === undefined) k2 = k;

if (index < 0) {
throw new Error("bit index must be greater than zero: got " + index);
throw new Error("bit index must be greater than zero: got ".concat(index));
}

@@ -61,0 +65,0 @@ return bitmap

@@ -15,3 +15,7 @@ "use strict";

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -84,3 +88,5 @@ if (k2 === undefined) k2 = k;

'uint8',
'uint64',
'uint256',
// This list should technically include all types from uint8 to uint256, and int8 to int256
'int8',

@@ -105,3 +111,3 @@ 'int256',

return (_a = {},
_a["Optional<" + typeName + ">"] = [
_a["Optional<".concat(typeName, ">")] = [
{ name: 'defined', type: 'bool' },

@@ -179,3 +185,3 @@ { name: 'value', type: typeName },

if (types[primaryType] === undefined) {
throw new Error("Unrecognized type " + primaryType + " is not included in the EIP-712 type list");
throw new Error("Unrecognized type ".concat(primaryType, " is not included in the EIP-712 type list"));
}

@@ -213,6 +219,6 @@ // Execute a depth-first search to populate the (inclusive) dependencies list.

var dep = deps_1_1.value;
result += dep + "(" + types[dep].map(function (_a) {
result += "".concat(dep, "(").concat(types[dep].map(function (_a) {
var name = _a.name, type = _a.type;
return type + " " + name;
}).join(',') + ")";
return "".concat(type, " ").concat(name);
}).join(','), ")");
}

@@ -267,3 +273,3 @@ }

}
throw new Error("Unrecognized or unsupported type in EIP-712 encoding: " + valueType);
throw new Error("Unrecognized or unsupported type in EIP-712 encoding: ".concat(valueType));
}

@@ -280,3 +286,3 @@ function normalizeValue(type, value) {

if (fields === undefined) {
throw new Error("Unrecognized primary type in EIP-712 encoding: " + primaryType);
throw new Error("Unrecognized primary type in EIP-712 encoding: ".concat(primaryType));
}

@@ -330,3 +336,3 @@ return Buffer.concat(fields.map(function (field) { return encodeValue(field.type, data[field.name], types); }));

if (fields === undefined) {
throw new Error("Unrecognized primary type for EIP-712 zero value: " + primaryType);
throw new Error("Unrecognized primary type for EIP-712 zero value: ".concat(primaryType));
}

@@ -333,0 +339,0 @@ return fields.reduce(function (obj, field) {

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

}
throw new Error("Unable to parse signature (expected signer " + signer + ")");
throw new Error("Unable to parse signature (expected signer ".concat(signer, ")"));
}

@@ -233,4 +233,4 @@ exports.parseSignatureWithoutPrefix = parseSignatureWithoutPrefix;

var v = parseInt(signature.slice(0, 2), 16);
var r = "0x" + signature.slice(2, 66);
var s = "0x" + signature.slice(66, 130);
var r = "0x".concat(signature.slice(2, 66));
var s = "0x".concat(signature.slice(66, 130));
if (v < 27) {

@@ -242,4 +242,4 @@ v += 27;

function parseSignatureAsRsv(signature) {
var r = "0x" + signature.slice(0, 64);
var s = "0x" + signature.slice(64, 128);
var r = "0x".concat(signature.slice(0, 64));
var s = "0x".concat(signature.slice(64, 128));
var v = parseInt(signature.slice(128, 130), 16);

@@ -246,0 +246,0 @@ if (v < 27) {

{
"name": "@celo/utils",
"version": "2.1.0",
"version": "2.2.0-alpha.1",
"description": "Celo common utils",

@@ -25,3 +25,3 @@ "author": "Celo",

"dependencies": {
"@celo/base": "2.1.0",
"@celo/base": "2.2.0-alpha.1",
"@types/bn.js": "^5.1.0",

@@ -28,0 +28,0 @@ "@types/elliptic": "^6.4.9",

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