Socket
Socket
Sign inDemoInstall

@celo/base

Package Overview
Dependencies
Maintainers
21
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@celo/base - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

1

lib/account.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MnemonicLanguages = exports.MnemonicStrength = exports.CELO_DERIVATION_PATH_BASE = void 0;
exports.CELO_DERIVATION_PATH_BASE = "m/44'/52752'/0'";

@@ -4,0 +5,0 @@ var MnemonicStrength;

12

lib/address.d.ts
/// <reference types="node" />
export declare type Address = string;
export declare const eqAddress: (a: string, b: string) => boolean;
export declare const normalizeAddress: (a: string) => string;
export declare const isNullAddress: (a: string) => boolean;
export declare const normalizeAddressWith0x: (a: string) => string;
export declare const eqAddress: (a: Address, b: Address) => boolean;
export declare const normalizeAddress: (a: Address) => string;
export declare const isNullAddress: (a: Address) => boolean;
export declare const normalizeAddressWith0x: (a: Address) => string;
export declare const trimLeading0x: (input: string) => string;

@@ -14,4 +14,4 @@ export declare const ensureLeading0x: (input: string) => string;

export declare const NULL_ADDRESS = "0x0000000000000000000000000000000000000000";
export declare const findAddressIndex: (address: string, addresses: string[]) => number;
export declare const mapAddressListOnto: (oldAddress: string[], newAddress: string[]) => any[];
export declare const findAddressIndex: (address: Address, addresses: Address[]) => number;
export declare const mapAddressListOnto: (oldAddress: Address[], newAddress: Address[]) => any[];
export declare function mapAddressListDataOnto<T>(data: T[], oldAddress: Address[], newAddress: Address[], initialValue: T): T[];
"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var bignumber_js_1 = __importDefault(require("bignumber.js"));
exports.mapAddressListDataOnto = exports.mapAddressListOnto = exports.findAddressIndex = exports.NULL_ADDRESS = exports.bufferToHex = exports.hexToBuffer = exports.isHexString = exports.getAddressChunks = exports.ensureLeading0x = exports.trimLeading0x = exports.normalizeAddressWith0x = exports.isNullAddress = exports.normalizeAddress = exports.eqAddress = void 0;
var HEX_REGEX = /^0x[0-9A-F]*$/i;
exports.eqAddress = function (a, b) { return exports.normalizeAddress(a) === exports.normalizeAddress(b); };
exports.normalizeAddress = function (a) { return exports.trimLeading0x(a).toLowerCase(); };
exports.isNullAddress = function (a) { return new bignumber_js_1.default(exports.normalizeAddress(a)).isZero(); };
exports.normalizeAddressWith0x = function (a) { return exports.ensureLeading0x(a).toLowerCase(); };
exports.trimLeading0x = function (input) { return (input.startsWith('0x') ? input.slice(2) : input); };
exports.ensureLeading0x = function (input) { return (input.startsWith('0x') ? input : "0x" + input); };
var eqAddress = function (a, b) { return (0, exports.normalizeAddress)(a) === (0, exports.normalizeAddress)(b); };
exports.eqAddress = eqAddress;
var normalizeAddress = function (a) { return (0, exports.trimLeading0x)(a).toLowerCase(); };
exports.normalizeAddress = normalizeAddress;
var isNullAddress = function (a) { return (0, exports.normalizeAddress)(a) === exports.NULL_ADDRESS; };
exports.isNullAddress = isNullAddress;
var normalizeAddressWith0x = function (a) { return (0, exports.ensureLeading0x)(a).toLowerCase(); };
exports.normalizeAddressWith0x = normalizeAddressWith0x;
var trimLeading0x = function (input) { return (input.startsWith('0x') ? input.slice(2) : input); };
exports.trimLeading0x = trimLeading0x;
var ensureLeading0x = function (input) { return (input.startsWith('0x') ? input : "0x" + input); };
exports.ensureLeading0x = ensureLeading0x;
// Turns '0xce10ce10ce10ce10ce10ce10ce10ce10ce10ce10'
// into ['ce10','ce10','ce10','ce10','ce10','ce10','ce10','ce10','ce10','ce10']
exports.getAddressChunks = function (input) {
return exports.trimLeading0x(input).match(/.{1,4}/g) || [];
var getAddressChunks = function (input) {
return (0, exports.trimLeading0x)(input).match(/.{1,4}/g) || [];
};
exports.isHexString = function (input) { return HEX_REGEX.test(input); };
exports.hexToBuffer = function (input) { return Buffer.from(exports.trimLeading0x(input), 'hex'); };
exports.bufferToHex = function (buf) { return exports.ensureLeading0x(buf.toString('hex')); };
exports.getAddressChunks = getAddressChunks;
var isHexString = function (input) { return HEX_REGEX.test(input); };
exports.isHexString = isHexString;
var hexToBuffer = function (input) { return Buffer.from((0, exports.trimLeading0x)(input), 'hex'); };
exports.hexToBuffer = hexToBuffer;
var bufferToHex = function (buf) { return (0, exports.ensureLeading0x)(buf.toString('hex')); };
exports.bufferToHex = bufferToHex;
exports.NULL_ADDRESS = '0x0000000000000000000000000000000000000000';
exports.findAddressIndex = function (address, addresses) {
return addresses.findIndex(function (x) { return exports.eqAddress(x, address); });
var findAddressIndex = function (address, addresses) {
return addresses.findIndex(function (x) { return (0, exports.eqAddress)(x, address); });
};
exports.findAddressIndex = findAddressIndex;
// Returns an array of indices mapping the entries of oldAddress[] to newAddress[]
exports.mapAddressListOnto = function (oldAddress, newAddress) {
var oldAddressIndex = oldAddress.map(function (x, index) { return ({ address: exports.normalizeAddress(x), index: index }); });
var newAddressIndex = newAddress.map(function (x, index) { return ({ address: exports.normalizeAddress(x), index: index }); });
var mapAddressListOnto = function (oldAddress, newAddress) {
var oldAddressIndex = oldAddress.map(function (x, index) { return ({ address: (0, exports.normalizeAddress)(x), index: index }); });
var newAddressIndex = newAddress.map(function (x, index) { return ({ address: (0, exports.normalizeAddress)(x), index: index }); });
oldAddressIndex.sort(function (a, b) { return a.address.localeCompare(b.address); });
newAddressIndex.sort(function (a, b) { return a.address.localeCompare(b.address); });
var res = __spreadArrays(Array(oldAddress.length).fill(-1));
var res = __spreadArray([], Array(oldAddress.length).fill(-1), true);
for (var i = 0, j = 0; i < oldAddress.length && j < newAddress.length;) {

@@ -57,10 +67,11 @@ var cmp = oldAddressIndex[i].address.localeCompare(newAddressIndex[j].address);

};
exports.mapAddressListOnto = mapAddressListOnto;
// Returns data[] reordered by mapAddressListOnto(), and initiaValue for any entry of
// oldAddress[] not present in newAddress[].
function mapAddressListDataOnto(data, oldAddress, newAddress, initialValue) {
var res = __spreadArrays(Array(oldAddress.length).fill(initialValue));
var res = __spreadArray([], Array(oldAddress.length).fill(initialValue), true);
if (data.length === 0) {
return res;
}
var addressIndexMap = exports.mapAddressListOnto(oldAddress, newAddress);
var addressIndexMap = (0, exports.mapAddressListOnto)(oldAddress, newAddress);
for (var i = 0; i < addressIndexMap.length; i++) {

@@ -67,0 +78,0 @@ if (addressIndexMap[i] >= 0) {

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

return __generator(this, function (_a) {
expect(address_1.getAddressChunks('0xce10ce10ce10ce10ce10ce10ce10ce10ce10ce10')).toEqual([
expect((0, address_1.getAddressChunks)('0xce10ce10ce10ce10ce10ce10ce10ce10ce10ce10')).toEqual([
'ce10',

@@ -46,0 +46,0 @@ 'ce10',

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.timeout = exports.concurrentValuesMap = exports.concurrentMap = exports.retryAsyncWithBackOffAndTimeout = exports.selectiveRetryAsyncWithBackOff = exports.retryAsyncWithBackOff = exports.retryAsync = exports.sleep = void 0;
var TAG = 'utils/src/async';

@@ -48,3 +49,3 @@ /** Sleep for a number of milliseconds */

// if all the tries fail it raises the last thrown exeption
exports.retryAsync = function (inFunction, tries, params, delay, logger) {
var retryAsync = function (inFunction, tries, params, delay, logger) {
if (delay === void 0) { delay = 100; }

@@ -86,5 +87,6 @@ if (logger === void 0) { logger = null; }

};
exports.retryAsync = retryAsync;
// Retries an async function when it raises an exeption
// if all the tries fail it raises the last thrown exeption
exports.retryAsyncWithBackOff = function (inFunction, tries, params, delay, factor, logger) {
var retryAsyncWithBackOff = function (inFunction, tries, params, delay, factor, logger) {
if (delay === void 0) { delay = 100; }

@@ -127,6 +129,7 @@ if (factor === void 0) { factor = 1.5; }

};
exports.retryAsyncWithBackOff = retryAsyncWithBackOff;
// Retries an async function when it raises an exeption
// if all the tries fail it raises the last thrown exeption
// throws automatically on specified errors
exports.selectiveRetryAsyncWithBackOff = function (inFunction, tries, dontRetry, params, delay, factor, logger) {
var selectiveRetryAsyncWithBackOff = function (inFunction, tries, dontRetry, params, delay, factor, logger) {
if (delay === void 0) { delay = 100; }

@@ -175,6 +178,7 @@ if (factor === void 0) { factor = 1.5; }

};
exports.selectiveRetryAsyncWithBackOff = selectiveRetryAsyncWithBackOff;
// Retries an async function when it raises an exeption
// Terminates any ongoing request when the timeout is reached
// if all the tries fail it raises the last thrown exeption
exports.retryAsyncWithBackOffAndTimeout = function (inFunction, tries, params, delayMs, factor, timeoutMs, logger) {
var retryAsyncWithBackOffAndTimeout = function (inFunction, tries, params, delayMs, factor, timeoutMs, logger) {
if (delayMs === void 0) { delayMs = 100; }

@@ -186,6 +190,7 @@ if (factor === void 0) { factor = 1.5; }

return __generator(this, function (_a) {
return [2 /*return*/, exports.timeout(exports.retryAsyncWithBackOff, [inFunction, tries, params, delayMs, factor, logger], timeoutMs, new Error("Timed out after " + timeoutMs + "ms"), TAG + "/@retryAsyncWithBackOffAndTimeout, Timed out after " + timeoutMs + "ms", logger)];
return [2 /*return*/, (0, exports.timeout)(exports.retryAsyncWithBackOff, [inFunction, tries, params, delayMs, factor, logger], timeoutMs, new Error("Timed out after " + timeoutMs + "ms"), TAG + "/@retryAsyncWithBackOffAndTimeout, Timed out after " + timeoutMs + "ms", logger)];
});
});
};
exports.retryAsyncWithBackOffAndTimeout = retryAsyncWithBackOffAndTimeout;
/**

@@ -206,5 +211,5 @@ * Map an async function over a list xs with a given concurrency level

_loop_1 = function (i) {
var remaining, sliceSize, slice, _a, _b;
return __generator(this, function (_c) {
switch (_c.label) {
var remaining, sliceSize, slice, _b, _c;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:

@@ -214,6 +219,6 @@ remaining = xs.length - i;

slice = xs.slice(i, i + sliceSize);
_b = (_a = res).concat;
_c = (_b = res).concat;
return [4 /*yield*/, Promise.all(slice.map(function (elem, index) { return mapFn(elem, i + index); }))];
case 1:
res = _b.apply(_a, [_c.sent()]);
res = _c.apply(_b, [_d.sent()]);
return [2 /*return*/];

@@ -276,3 +281,3 @@ }

*/
exports.timeout = function (inFunction, params, timeoutMs, timeoutError, timeoutLogMsg, logger) {
var timeout = function (inFunction, params, timeoutMs, timeoutError, timeoutLogMsg, logger) {
if (timeoutLogMsg === void 0) { timeoutLogMsg = null; }

@@ -295,2 +300,3 @@ if (logger === void 0) { logger = null; }

};
exports.timeout = timeout;
//# sourceMappingURL=async.js.map

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

mockFunction = jest.fn();
return [4 /*yield*/, async_1.retryAsync(mockFunction, 3, [], 1)];
return [4 /*yield*/, (0, async_1.retryAsync)(mockFunction, 3, [], 1)];
case 1:

@@ -67,3 +67,3 @@ _a.sent();

_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, async_1.retryAsync(mockFunction, 3, [], 1)];
return [4 /*yield*/, (0, async_1.retryAsync)(mockFunction, 3, [], 1)];
case 2:

@@ -97,3 +97,3 @@ _a.sent();

_b.trys.push([1, 3, , 4]);
return [4 /*yield*/, async_1.selectiveRetryAsyncWithBackOff(mockFunction, 3, ['test error'], [])];
return [4 /*yield*/, (0, async_1.selectiveRetryAsyncWithBackOff)(mockFunction, 3, ['test error'], [])];
case 2:

@@ -123,3 +123,3 @@ _b.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, async_1.sleep(10)];
case 0: return [4 /*yield*/, (0, async_1.sleep)(10)];
case 1:

@@ -131,3 +131,3 @@ _a.sent();

}); });
return [4 /*yield*/, async_1.retryAsyncWithBackOffAndTimeout(mockFunction, 3, [], 1)];
return [4 /*yield*/, (0, async_1.retryAsyncWithBackOffAndTimeout)(mockFunction, 3, [], 1)];
case 1:

@@ -152,3 +152,3 @@ result = _a.sent();

_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, async_1.retryAsyncWithBackOffAndTimeout(mockFunction, 3, [], 1, 1, 100)];
return [4 /*yield*/, (0, async_1.retryAsyncWithBackOffAndTimeout)(mockFunction, 3, [], 1, 1, 100)];
case 2:

@@ -176,3 +176,3 @@ _a.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, async_1.sleep(1000)];
case 0: return [4 /*yield*/, (0, async_1.sleep)(1000)];
case 1:

@@ -187,3 +187,3 @@ _a.sent();

_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, async_1.retryAsyncWithBackOffAndTimeout(mockFunction, 3, [], 1, 1, 100)];
return [4 /*yield*/, (0, async_1.retryAsyncWithBackOffAndTimeout)(mockFunction, 3, [], 1, 1, 100)];
case 2:

@@ -214,3 +214,3 @@ _a.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, async_1.sleep(5)];
case 0: return [4 /*yield*/, (0, async_1.sleep)(5)];
case 1:

@@ -239,3 +239,3 @@ _a.sent();

expected = _a.sent();
return [4 /*yield*/, async_1.concurrentMap(3, xs, fn)];
return [4 /*yield*/, (0, async_1.concurrentMap)(3, xs, fn)];
case 2:

@@ -258,5 +258,5 @@ result = _a.sent();

p1 = Promise.all(xs.map(c1.inc));
p2 = async_1.concurrentMap(2, xs, c2.inc);
p2 = (0, async_1.concurrentMap)(2, xs, c2.inc);
// sleep enough for Promise.all to finish
return [4 /*yield*/, async_1.sleep(7)];
return [4 /*yield*/, (0, async_1.sleep)(7)];
case 1:

@@ -267,3 +267,3 @@ // sleep enough for Promise.all to finish

expect(c1.val()).not.toEqual(c2.val());
return [4 /*yield*/, async_1.sleep(20)];
return [4 /*yield*/, (0, async_1.sleep)(20)];
case 2:

@@ -289,4 +289,4 @@ _a.sent();

xs = [1, 3, 4];
p = async_1.concurrentMap(5, xs, c.inc);
return [4 /*yield*/, async_1.sleep(7)];
p = (0, async_1.concurrentMap)(5, xs, c.inc);
return [4 /*yield*/, (0, async_1.sleep)(7)];
case 1:

@@ -312,3 +312,3 @@ _a.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, async_1.sleep(1000)];
case 0: return [4 /*yield*/, (0, async_1.sleep)(1000)];
case 1:

@@ -324,3 +324,3 @@ _a.sent();

_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, async_1.timeout(mockFunction, [], 900, timeoutError)];
return [4 /*yield*/, (0, async_1.timeout)(mockFunction, [], 900, timeoutError)];
case 2:

@@ -327,0 +327,0 @@ _a.sent();

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AttestationBase = exports.isAccountConsideredVerified = exports.extractAttestationCodeFromMessage = exports.messageContainsAttestationCode = exports.sanitizeMessageBase64 = exports.base64ToHex = exports.hashIdentifier = exports.getIdentifierPrefix = exports.IdentifierType = void 0;
var phoneNumbers_1 = require("./phoneNumbers");

@@ -25,3 +26,3 @@ var DEFAULT_NUM_ATTESTATIONS_REQUIRED = 3;

case IdentifierType.PHONE_NUMBER:
return phoneNumbers_1.getPhoneHash(sha3, identifier, salt);
return (0, phoneNumbers_1.getPhoneHash)(sha3, identifier, salt);
default:

@@ -28,0 +29,0 @@ throw new Error('Unsupported Identifier Type');

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

it('should check if a message contains a attestation code', function () {
expect(attestations_1.messageContainsAttestationCode(MESSAGE_1)).toBeTruthy();
expect(attestations_1.messageContainsAttestationCode(MESSAGE_2)).toBeTruthy();
expect(attestations_1.messageContainsAttestationCode(MESSAGE_3)).toBeTruthy();
expect(attestations_1.messageContainsAttestationCode(MESSAGE_3_WITH_LINK)).toBeTruthy();
expect((0, attestations_1.messageContainsAttestationCode)(MESSAGE_1)).toBeTruthy();
expect((0, attestations_1.messageContainsAttestationCode)(MESSAGE_2)).toBeTruthy();
expect((0, attestations_1.messageContainsAttestationCode)(MESSAGE_3)).toBeTruthy();
expect((0, attestations_1.messageContainsAttestationCode)(MESSAGE_3_WITH_LINK)).toBeTruthy();
});
it('should fail if a message does not contain a attestation code', function () {
expect(attestations_1.messageContainsAttestationCode('asdfasdaf')).toBeFalsy();
expect(attestations_1.messageContainsAttestationCode('')).toBeFalsy();
expect(attestations_1.messageContainsAttestationCode('Howdy there')).toBeFalsy();
expect((0, attestations_1.messageContainsAttestationCode)('asdfasdaf')).toBeFalsy();
expect((0, attestations_1.messageContainsAttestationCode)('')).toBeFalsy();
expect((0, attestations_1.messageContainsAttestationCode)('Howdy there')).toBeFalsy();
});

@@ -30,7 +30,7 @@ });

it('should extract the code from a message', function () {
expect(attestations_1.extractAttestationCodeFromMessage(MESSAGE_1)).toBe(MESSAGE_1_DECODED);
expect(attestations_1.extractAttestationCodeFromMessage(MESSAGE_2)).toBe(MESSAGE_2_DECODED);
expect(attestations_1.extractAttestationCodeFromMessage(MESSAGE_3)).toBe(MESSAGE_3_DECODED);
expect(attestations_1.extractAttestationCodeFromMessage(MESSAGE_3_WITH_LINK)).toBe(MESSAGE_3_DECODED);
expect(attestations_1.extractAttestationCodeFromMessage(MESSAGE_4_UNSANITIZED)).toBe(MESSAGE_4_DECODED);
expect((0, attestations_1.extractAttestationCodeFromMessage)(MESSAGE_1)).toBe(MESSAGE_1_DECODED);
expect((0, attestations_1.extractAttestationCodeFromMessage)(MESSAGE_2)).toBe(MESSAGE_2_DECODED);
expect((0, attestations_1.extractAttestationCodeFromMessage)(MESSAGE_3)).toBe(MESSAGE_3_DECODED);
expect((0, attestations_1.extractAttestationCodeFromMessage)(MESSAGE_3_WITH_LINK)).toBe(MESSAGE_3_DECODED);
expect((0, attestations_1.extractAttestationCodeFromMessage)(MESSAGE_4_UNSANITIZED)).toBe(MESSAGE_4_DECODED);
});

@@ -46,5 +46,5 @@ });

it('sanitizes correctly', function () {
expect(attestations_1.sanitizeMessageBase64(CODE_1)).toBe(SANITIZED_CODE_1);
expect(attestations_1.sanitizeMessageBase64(CODE_2)).toBe(SANITIZED_CODE_2);
expect(attestations_1.sanitizeMessageBase64(NORMAL_CODE)).toBe(NORMAL_CODE);
expect((0, attestations_1.sanitizeMessageBase64)(CODE_1)).toBe(SANITIZED_CODE_1);
expect((0, attestations_1.sanitizeMessageBase64)(CODE_2)).toBe(SANITIZED_CODE_2);
expect((0, attestations_1.sanitizeMessageBase64)(NORMAL_CODE)).toBe(NORMAL_CODE);
});

@@ -51,0 +51,0 @@ });

"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.linkedListChanges = exports.linkedListChange = exports.intersection = exports.notEmpty = exports.zeroRange = exports.zip3 = exports.zip = void 0;
var address_1 = require("./address");

@@ -57,3 +60,3 @@ function zip(fn, as, bs) {

function upsert(sortedList, change, comparator) {
var oldIdx = sortedList.findIndex(function (a) { return address_1.eqAddress(a.address, change.address); });
var oldIdx = sortedList.findIndex(function (a) { return (0, address_1.eqAddress)(a.address, change.address); });
if (oldIdx === -1) {

@@ -87,3 +90,3 @@ throw new Error('');

function linkedListChanges(sortedList, changeList, comparator) {
var listClone = __spreadArrays(sortedList);
var listClone = __spreadArray([], sortedList, true);
var lessers = [];

@@ -90,0 +93,0 @@ var greaters = [];

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

};
expect(collections_1.linkedListChange(lst, change, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChange)(lst, change, bnc)).toMatchObject(expected);
});

@@ -35,3 +35,3 @@ it('becoming greatest', function () {

};
expect(collections_1.linkedListChange(lst, change, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChange)(lst, change, bnc)).toMatchObject(expected);
});

@@ -51,3 +51,3 @@ it('becoming smallest', function () {

};
expect(collections_1.linkedListChange(lst, change, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChange)(lst, change, bnc)).toMatchObject(expected);
});

@@ -69,3 +69,3 @@ it('change order', function () {

};
expect(collections_1.linkedListChange(lst, change, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChange)(lst, change, bnc)).toMatchObject(expected);
});

@@ -81,3 +81,3 @@ });

};
expect(collections_1.linkedListChanges(lst, changes, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChanges)(lst, changes, bnc)).toMatchObject(expected);
});

@@ -96,3 +96,3 @@ it('becoming greatest', function () {

};
expect(collections_1.linkedListChanges(lst, changes, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChanges)(lst, changes, bnc)).toMatchObject(expected);
});

@@ -112,3 +112,3 @@ it('becoming smallest', function () {

};
expect(collections_1.linkedListChanges(lst, changes, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChanges)(lst, changes, bnc)).toMatchObject(expected);
});

@@ -130,3 +130,3 @@ it('change order', function () {

};
expect(collections_1.linkedListChanges(lst, changes, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChanges)(lst, changes, bnc)).toMatchObject(expected);
});

@@ -151,3 +151,3 @@ it('change order, become smallest', function () {

};
expect(collections_1.linkedListChanges(lst, changes, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChanges)(lst, changes, bnc)).toMatchObject(expected);
});

@@ -172,3 +172,3 @@ it('change order, become largest', function () {

};
expect(collections_1.linkedListChanges(lst, changes, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChanges)(lst, changes, bnc)).toMatchObject(expected);
});

@@ -193,3 +193,3 @@ it('change order, then replace with another', function () {

};
expect(collections_1.linkedListChanges(lst, changes, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChanges)(lst, changes, bnc)).toMatchObject(expected);
});

@@ -215,3 +215,3 @@ it('change order, then replace with another again', function () {

};
expect(collections_1.linkedListChanges(lst, changes, bnc)).toMatchObject(expected);
expect((0, collections_1.linkedListChanges)(lst, changes, bnc)).toMatchObject(expected);
});

@@ -218,0 +218,0 @@ });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getContactPhoneNumber = function (contact) {
exports.isContact = exports.getContactPhoneNumber = void 0;
var getContactPhoneNumber = function (contact) {
if (!contact) {

@@ -13,2 +14,3 @@ throw new Error('Invalid contact');

};
exports.getContactPhoneNumber = getContactPhoneNumber;
function isContact(contactOrNumber) {

@@ -15,0 +17,0 @@ if (typeof contactOrNumber === 'object') {

"use strict";
var _a, _b;
Object.defineProperty(exports, "__esModule", { value: true });
exports.currencyToShortMap = exports.SHORT_CURRENCIES = exports.resolveCurrency = exports.CURRENCIES = exports.CURRENCY_ENUM = void 0;
var CURRENCY_ENUM;

@@ -27,3 +28,3 @@ (function (CURRENCY_ENUM) {

_a);
exports.resolveCurrency = function (label) {
var resolveCurrency = function (label) {
if (label && label.toLowerCase().includes('dollar')) {

@@ -43,2 +44,3 @@ return CURRENCY_ENUM.DOLLAR;

};
exports.resolveCurrency = resolveCurrency;
var SHORT_CURRENCIES;

@@ -45,0 +47,0 @@ (function (SHORT_CURRENCIES) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorMessage = void 0;
function getErrorMessage(error) {

@@ -4,0 +5,0 @@ // This replacement is because when the error reaches here, it's been wrapped

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pipeToFuture = exports.toFuture = exports.Future = void 0;
// A Future is like an exernally fulfillable (resolvable) promise

@@ -18,3 +19,3 @@ var Future = /** @class */ (function () {

},
enumerable: true,
enumerable: false,
configurable: true

@@ -26,3 +27,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -29,0 +30,0 @@ });

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
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]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./account"));
__export(require("./address"));
__export(require("./async"));
__export(require("./attestations"));
__export(require("./collections"));
__export(require("./contacts"));
__export(require("./currencies"));
__export(require("./displayFormatting"));
__export(require("./future"));
__export(require("./inputValidation"));
__export(require("./io"));
__export(require("./logger"));
__export(require("./parsing"));
__export(require("./phoneNumbers"));
__export(require("./result"));
__export(require("./signatureUtils"));
__export(require("./string"));
__export(require("./task"));
__exportStar(require("./account"), exports);
__exportStar(require("./address"), exports);
__exportStar(require("./async"), exports);
__exportStar(require("./attestations"), exports);
__exportStar(require("./collections"), exports);
__exportStar(require("./contacts"), exports);
__exportStar(require("./currencies"), exports);
__exportStar(require("./displayFormatting"), exports);
__exportStar(require("./future"), exports);
__exportStar(require("./inputValidation"), exports);
__exportStar(require("./io"), exports);
__exportStar(require("./logger"), exports);
__exportStar(require("./parsing"), exports);
__exportStar(require("./phoneNumbers"), exports);
__exportStar(require("./result"), exports);
__exportStar(require("./signatureUtils"), exports);
__exportStar(require("./string"), exports);
__exportStar(require("./task"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateDecimal = exports.validateInteger = exports.ValidatorKind = void 0;
var ValidatorKind;

@@ -4,0 +5,0 @@ (function (ValidatorKind) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidUrl = exports.URL_REGEX = void 0;
// from http://urlregex.com/
exports.URL_REGEX = new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/);
exports.isValidUrl = function (url) { return exports.URL_REGEX.test(url); };
var isValidUrl = function (url) { return exports.URL_REGEX.test(url); };
exports.isValidUrl = isValidUrl;
//# sourceMappingURL=io.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Lock = void 0;
var events_1 = require("events");

@@ -4,0 +5,0 @@ var LockEvent;

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

switch (_a.label) {
case 0: return [4 /*yield*/, async_1.sleep(Math.floor(Math.random() * 10))];
case 0: return [4 /*yield*/, (0, async_1.sleep)(Math.floor(Math.random() * 10))];
case 1:

@@ -48,0 +48,0 @@ _a.sent();

"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.noopLogger = function () {
exports.consoleLogger = exports.prefixLogger = exports.noopLogger = void 0;
var noopLogger = function () {
/*noop*/
};
exports.prefixLogger = function (prefix, logger) {
exports.noopLogger = noopLogger;
var prefixLogger = function (prefix, logger) {
if (logger === exports.noopLogger) {

@@ -23,7 +27,8 @@ return exports.noopLogger;

}
return logger.apply(void 0, __spreadArrays([prefix + ":: "], args));
return logger.apply(void 0, __spreadArray([prefix + ":: "], args, false));
};
}
};
exports.prefixLogger = prefixLogger;
exports.consoleLogger = console.log;
//# sourceMappingURL=logger.js.map

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

var fs_1 = require("fs");
var pdef = JSON.parse(fs_1.readFileSync('./package.json', 'utf-8'));
var pdef = JSON.parse((0, fs_1.readFileSync)('./package.json', 'utf-8'));
describe('Base package', function () {

@@ -8,0 +8,0 @@ // @celo/base is built on the premise of having absolutely no dependencies, no exceptions made

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringToBoolean = function (inputString) {
exports.parseSolidityStringArray = exports.stringToBoolean = void 0;
var stringToBoolean = function (inputString) {
var lowercasedInput = inputString.toLowerCase().trim();

@@ -13,2 +14,3 @@ if (lowercasedInput === 'true') {

};
exports.stringToBoolean = stringToBoolean;
/**

@@ -20,3 +22,3 @@ * Parses an "array of strings" that is returned from a Solidity function

*/
exports.parseSolidityStringArray = function (stringLengths, data) {
var parseSolidityStringArray = function (stringLengths, data) {
if (data === null) {

@@ -37,2 +39,3 @@ data = '0x';

};
exports.parseSolidityStringArray = parseSolidityStringArray;
//# sourceMappingURL=parsing.js.map

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

test('stringToBoolean()', function () {
expect(parsing_1.stringToBoolean('true')).toBe(true);
expect(parsing_1.stringToBoolean(' true ')).toBe(true);
expect(parsing_1.stringToBoolean('false')).toBe(false);
expect(parsing_1.stringToBoolean(' false ')).toBe(false);
expect(parsing_1.stringToBoolean('FaLse')).toBe(false);
expect(parsing_1.stringToBoolean('TruE')).toBe(true);
expect(function () { return parsing_1.stringToBoolean('fals'); }).toThrow("Unable to parse 'fals' as boolean");
expect((0, parsing_1.stringToBoolean)('true')).toBe(true);
expect((0, parsing_1.stringToBoolean)(' true ')).toBe(true);
expect((0, parsing_1.stringToBoolean)('false')).toBe(false);
expect((0, parsing_1.stringToBoolean)(' false ')).toBe(false);
expect((0, parsing_1.stringToBoolean)('FaLse')).toBe(false);
expect((0, parsing_1.stringToBoolean)('TruE')).toBe(true);
expect(function () { return (0, parsing_1.stringToBoolean)('fals'); }).toThrow("Unable to parse 'fals' as boolean");
});
//# sourceMappingURL=parsing.test.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PhoneNumberBase = exports.anonymizedPhone = exports.isE164Number = exports.getPhoneHash = void 0;
var attestations_1 = require("./attestations");
var PHONE_SALT_SEPARATOR = '__';
var E164_REGEX = /^\+[1-9][0-9]{1,14}$/;
exports.getPhoneHash = function (sha3, phoneNumber, salt) {
var getPhoneHash = function (sha3, phoneNumber, salt) {
if (!phoneNumber || !isE164Number(phoneNumber)) {
throw Error('Attempting to hash a non-e164 number: ' + phoneNumber);
}
var prefix = attestations_1.getIdentifierPrefix(attestations_1.IdentifierType.PHONE_NUMBER);
var prefix = (0, attestations_1.getIdentifierPrefix)(attestations_1.IdentifierType.PHONE_NUMBER);
var value = prefix + (salt ? phoneNumber + PHONE_SALT_SEPARATOR + salt : phoneNumber);
return sha3(value);
};
exports.getPhoneHash = getPhoneHash;
function isE164Number(phoneNumber) {

@@ -15,0 +17,0 @@ return E164_REGEX.test(phoneNumber);

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

var phoneNumbers_1 = require("./phoneNumbers");
var sha3 = function (v) { return web3_utils_1.soliditySha3({ type: 'string', value: v }); };
var sha3 = function (v) { return (0, web3_utils_1.soliditySha3)({ type: 'string', value: v }); };
var TEST_PHONE_NUMBERS = {

@@ -36,10 +36,10 @@ VALID_US_1: '6282287826',

it('Hashes an valid number without a salt', function () {
expect(phoneNumbers_1.getPhoneHash(sha3, TEST_PHONE_NUMBERS.VALID_E164, '')).toBe('0x483128504c69591aed5751690805ba9aad6c390644421dc189f6dbb6e085aadf');
expect((0, phoneNumbers_1.getPhoneHash)(sha3, TEST_PHONE_NUMBERS.VALID_E164, '')).toBe('0x483128504c69591aed5751690805ba9aad6c390644421dc189f6dbb6e085aadf');
});
it('Hashes an valid number with a salt', function () {
expect(phoneNumbers_1.getPhoneHash(sha3, TEST_PHONE_NUMBERS.VALID_E164, 'abcdefg')).toBe('0xf08257f6b126597dbd090fecf4f5106cfb59c98ef997644cef16f9349464810c');
expect((0, phoneNumbers_1.getPhoneHash)(sha3, TEST_PHONE_NUMBERS.VALID_E164, 'abcdefg')).toBe('0xf08257f6b126597dbd090fecf4f5106cfb59c98ef997644cef16f9349464810c');
});
it('Throws for an invalid number', function () {
try {
phoneNumbers_1.getPhoneHash(sha3, TEST_PHONE_NUMBERS.VALID_US_1, '');
(0, phoneNumbers_1.getPhoneHash)(sha3, TEST_PHONE_NUMBERS.VALID_US_1, '');
fail('expected an error');

@@ -55,8 +55,8 @@ }

// @ts-ignore
expect(phoneNumbers_1.isE164Number(null)).toBe(false);
expect(phoneNumbers_1.isE164Number('')).toBe(false);
expect(phoneNumbers_1.isE164Number(TEST_PHONE_NUMBERS.VALID_US_1)).toBe(false);
expect(phoneNumbers_1.isE164Number(TEST_PHONE_NUMBERS.VALID_US_2)).toBe(false);
expect(phoneNumbers_1.isE164Number(TEST_PHONE_NUMBERS.VALID_US_3)).toBe(true);
expect(phoneNumbers_1.isE164Number(TEST_PHONE_NUMBERS.VALID_US_4)).toBe(false);
expect((0, phoneNumbers_1.isE164Number)(null)).toBe(false);
expect((0, phoneNumbers_1.isE164Number)('')).toBe(false);
expect((0, phoneNumbers_1.isE164Number)(TEST_PHONE_NUMBERS.VALID_US_1)).toBe(false);
expect((0, phoneNumbers_1.isE164Number)(TEST_PHONE_NUMBERS.VALID_US_2)).toBe(false);
expect((0, phoneNumbers_1.isE164Number)(TEST_PHONE_NUMBERS.VALID_US_3)).toBe(true);
expect((0, phoneNumbers_1.isE164Number)(TEST_PHONE_NUMBERS.VALID_US_4)).toBe(false);
});

@@ -63,0 +63,0 @@ });

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -53,10 +55,13 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.Ok = function (result) { return ({
exports.isErr = exports.isOk = exports.parseJsonAsResult = exports.JSONParseError = exports.JSONParseErrorType = exports.RootError = exports.makeAsyncThrowable = exports.makeThrowable = exports.throwIfError = exports.Err = exports.Ok = void 0;
var Ok = function (result) { return ({
ok: true,
result: result,
}); };
exports.Err = function (error) { return ({
exports.Ok = Ok;
var Err = function (error) { return ({
ok: false,
error: error,
}); };
exports.Err = Err;
function throwIfError(result, errorModifier) {

@@ -132,6 +137,6 @@ if (!result.ok) {

try {
return exports.Ok(JSON.parse(data));
return (0, exports.Ok)(JSON.parse(data));
}
catch (error) {
return exports.Err(new JSONParseError(error));
return (0, exports.Err)(new JSONParseError(error));
}

@@ -138,0 +143,0 @@ }

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

describe('discriminated collection functions', function () {
var trueValue = _1.Ok(true);
var falseValue = _1.Err(new Error());
var trueValue = (0, _1.Ok)(true);
var falseValue = (0, _1.Err)(new Error());
var collection = [trueValue, falseValue];

@@ -10,0 +10,0 @@ it('can filter to the true value', function () {

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.SignatureBase = exports.serializeSignature = exports.NativeSigner = exports.POP_SIZE = void 0;
exports.POP_SIZE = 65;

@@ -41,0 +42,0 @@ // Uses a native function to sign (as signFn), most commonly `web.eth.sign`

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StringBase = exports.normalizeAccents = exports.appendPath = void 0;
function appendPath(baseUrl, path) {

@@ -4,0 +5,0 @@ var lastChar = baseUrl[baseUrl.length - 1];

@@ -50,2 +50,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.tryObtainValueWithRetries = exports.conditionWatcher = exports.repeatTask = void 0;
var future_1 = require("./future");

@@ -60,3 +61,3 @@ var logger_1 = require("./logger");

if (opts.logger) {
return logger_1.prefixLogger(opts.name, opts.logger);
return (0, logger_1.prefixLogger)(opts.name, opts.logger);
}

@@ -63,0 +64,0 @@ else {

@@ -48,7 +48,7 @@ "use strict";

fn = jest.fn().mockResolvedValue(null);
task = task_1.repeatTask({
task = (0, task_1.repeatTask)({
name: 'testTask',
timeInBetweenMS: 10,
}, fn);
return [4 /*yield*/, async_1.sleep(15)];
return [4 /*yield*/, (0, async_1.sleep)(15)];
case 1:

@@ -58,3 +58,3 @@ _a.sent();

task.stop();
return [4 /*yield*/, async_1.sleep(10)];
return [4 /*yield*/, (0, async_1.sleep)(10)];
case 2:

@@ -74,7 +74,7 @@ _a.sent();

fn = jest.fn().mockRejectedValue(new Error('Failed'));
task = task_1.repeatTask({
task = (0, task_1.repeatTask)({
name: 'testTask',
timeInBetweenMS: 10,
}, fn);
return [4 /*yield*/, async_1.sleep(35)];
return [4 /*yield*/, (0, async_1.sleep)(35)];
case 1:

@@ -100,7 +100,7 @@ _a.sent();

}); });
task = task_1.repeatTask({
task = (0, task_1.repeatTask)({
name: 'testTask',
timeInBetweenMS: 10,
}, fn);
return [4 /*yield*/, async_1.sleep(35)];
return [4 /*yield*/, (0, async_1.sleep)(35)];
case 1:

@@ -128,3 +128,3 @@ _a.sent();

logger = jest.fn();
task_1.repeatTask({
(0, task_1.repeatTask)({
name: 'testTask',

@@ -134,3 +134,3 @@ timeInBetweenMS: 10,

}, fn);
return [4 /*yield*/, async_1.sleep(5)];
return [4 /*yield*/, (0, async_1.sleep)(5)];
case 1:

@@ -160,7 +160,7 @@ _b.sent();

}); });
task = task_1.repeatTask({
task = (0, task_1.repeatTask)({
name: 'testTask',
timeInBetweenMS: 10,
}, fn);
return [4 /*yield*/, async_1.sleep(25)];
return [4 /*yield*/, (0, async_1.sleep)(25)];
case 1:

@@ -180,3 +180,3 @@ _a.sent();

fn = jest.fn().mockResolvedValue(null);
task = task_1.repeatTask({
task = (0, task_1.repeatTask)({
name: 'testTask',

@@ -186,7 +186,7 @@ initialDelayMS: 10,

}, fn);
return [4 /*yield*/, async_1.sleep(2)];
return [4 /*yield*/, (0, async_1.sleep)(2)];
case 1:
_a.sent();
expect(fn).toHaveBeenCalledTimes(0);
return [4 /*yield*/, async_1.sleep(10)];
return [4 /*yield*/, (0, async_1.sleep)(10)];
case 2:

@@ -209,3 +209,3 @@ _a.sent();

onSuccess = jest.fn();
task = task_1.conditionWatcher({
task = (0, task_1.conditionWatcher)({
name: 'testCondition',

@@ -216,3 +216,3 @@ onSuccess: onSuccess,

});
return [4 /*yield*/, async_1.sleep(25)];
return [4 /*yield*/, (0, async_1.sleep)(25)];
case 1:

@@ -237,3 +237,3 @@ _a.sent();

onSuccess = jest.fn();
task = task_1.conditionWatcher({
task = (0, task_1.conditionWatcher)({
name: 'testCondition',

@@ -244,3 +244,3 @@ onSuccess: onSuccess,

});
return [4 /*yield*/, async_1.sleep(25)];
return [4 /*yield*/, (0, async_1.sleep)(25)];
case 1:

@@ -262,3 +262,3 @@ _a.sent();

onSuccess = jest.fn().mockRejectedValue(new Error('fail'));
task = task_1.conditionWatcher({
task = (0, task_1.conditionWatcher)({
name: 'testCondition',

@@ -269,3 +269,3 @@ onSuccess: onSuccess,

});
return [4 /*yield*/, async_1.sleep(25)];
return [4 /*yield*/, (0, async_1.sleep)(25)];
case 1:

@@ -286,3 +286,3 @@ _a.sent();

case 0:
task = task_1.tryObtainValueWithRetries({
task = (0, task_1.tryObtainValueWithRetries)({
name: 'testGet',

@@ -305,3 +305,3 @@ maxAttemps: 2,

case 0:
task = task_1.tryObtainValueWithRetries({
task = (0, task_1.tryObtainValueWithRetries)({
name: 'testGet',

@@ -328,3 +328,3 @@ maxAttemps: 2,

case 0:
task = task_1.tryObtainValueWithRetries({
task = (0, task_1.tryObtainValueWithRetries)({
name: 'testGet',

@@ -351,3 +351,3 @@ maxAttemps: 2,

tryGetValue = jest.fn().mockResolvedValue(null);
task = task_1.tryObtainValueWithRetries({
task = (0, task_1.tryObtainValueWithRetries)({
name: 'testGet',

@@ -358,3 +358,3 @@ maxAttemps: 15,

});
return [4 /*yield*/, async_1.sleep(15)];
return [4 /*yield*/, (0, async_1.sleep)(15)];
case 1:

@@ -367,3 +367,3 @@ _a.sent();

currentCalls = tryGetValue.mock.calls.length;
return [4 /*yield*/, async_1.sleep(10)];
return [4 /*yield*/, (0, async_1.sleep)(10)];
case 3:

@@ -370,0 +370,0 @@ _a.sent();

{
"name": "@celo/base",
"version": "1.3.2",
"version": "1.3.3",
"description": "Celo base common utils, no dependencies",

@@ -5,0 +5,0 @@ "author": "Celo",

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

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