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

slopes

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slopes - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

package.json
{
"name": "slopes",
"version": "1.2.0",
"version": "1.2.1",
"description": "AVA Platform JS Library",

@@ -5,0 +5,0 @@ "main": "typings/src/index.js",

@@ -143,2 +143,4 @@ /**

asset = bintools.avaSerialize(assetID);
} else {
asset = assetID;
}

@@ -145,0 +147,0 @@ let params = {

@@ -14,28 +14,2 @@ /**

/**
* Output:
*
* Output Payment:
* Amount | 08 bytes
* Locktime | 08 bytes
* Threshold | 04 bytes
* NumAddrs | 04 bytes
* Repeated (NumAddrs):
* Addr | 20 bytes
*/
/* Output Take-or-Leave:
* OutputID | 04 bytes
* Amount | 08 bytes
* Locktime | 08 bytes
* Threshold | 04 bytes
* NumAddrs | 04 bytes
* Repeated (NumAddrs):
* Addr | 20 bytes
* FallLocktime | 08 bytes
* FallThreshold | 04 bytes
* NumFallAddrs | 04 bytes
* Repeated (NumFallAddrs):
* Addr | 20 bytes
*/
/**
* Takes a buffer representing the output and returns the proper Output instance.

@@ -42,0 +16,0 @@ *

@@ -87,3 +87,3 @@ import mockAxios from 'jest-mock-axios';

test('getAssetDescription', async ()=>{
test('getAssetDescription as string', async ()=>{
let assetid:string = "8a5d2d32e68bc50036e4d086044617fe4a0a0296b274999ba568ea92da46d533";

@@ -110,2 +110,24 @@

test('getAssetDescription as Buffer', async ()=>{
let assetid:Buffer = Buffer.from("8a5d2d32e68bc50036e4d086044617fe4a0a0296b274999ba568ea92da46d533");
let result:Promise<object> = api.getAssetDescription(assetid);
let payload:object = {
"result": {
'name': "Collin Coin",
'symbol': 'CKC'
}
};
let responseObj = {
data: payload
};
mockAxios.mockResponse(responseObj);
let response:object = await result;
expect(mockAxios.request).toHaveBeenCalledTimes(1);
expect(response["name"]).toBe("Collin Coin");
expect(response["symbol"]).toBe("CKC");
});
test('getUTXOs', async ()=>{

@@ -112,0 +134,0 @@ //Payment

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

}
else {
asset = assetID;
}
let params = {

@@ -276,2 +279,2 @@ "assetID": asset

exports.default = AVMAPI;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2FwaXMvYXZtL2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUlBLG9DQUFpQztBQUNqQyw2Q0FBaUU7QUFDakUsbUNBQWtDO0FBQ2xDLG1DQUE2QztBQUM3Qyx5Q0FBeUM7QUFDekMsNkJBQXNDO0FBQ3RDLGtEQUF1QjtBQUN2QixvRUFBNEM7QUFFNUM7O0dBRUc7QUFDSCxNQUFNLFFBQVEsR0FBRyxrQkFBUSxDQUFDLFdBQVcsRUFBRSxDQUFDO0FBRXhDOzs7R0FHRztBQUNILE1BQWEsa0JBQWtCO0lBMEIzQjs7Ozs7Ozs7Ozs7Ozs7O09BZUc7SUFDSCxZQUFZLElBQVcsRUFBRSxZQUFvQixLQUFLLEVBQUUsU0FBbUI7UUF6QzdELFNBQUksR0FBVSxTQUFTLENBQUM7UUFDeEIsY0FBUyxHQUFXLEtBQUssQ0FBQztRQUMxQixjQUFTLEdBQWEsT0FBTyxDQUFDO1FBRXhDOztXQUVHO1FBQ0gsWUFBTyxHQUFHLEdBQVUsRUFBRTtZQUNsQixPQUFPLElBQUksQ0FBQyxJQUFJLENBQUM7UUFDckIsQ0FBQyxDQUFBO1FBRUQ7O1dBRUc7UUFDSCxpQkFBWSxHQUFHLEdBQVcsRUFBRTtZQUN4QixPQUFPLElBQUksQ0FBQyxTQUFTLENBQUM7UUFDMUIsQ0FBQyxDQUFBO1FBRUQ7O1d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ICAgICAgaWYoQXJyYXkuaXNBcnJheShzZWxmQXJyYXkpKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHV0eG9zLmFkZEFycmF5KGRhdGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNlbGY6VVRYT1NldCA9IG5ldyBVVFhPU2V0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmFkZEFycmF5KHNlbGZBcnJheSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm1lcmdlQnlSdWxlKHV0eG9zLCBwZXJzaXN0T3B0cy5nZXRNZXJnZVJ1bGUoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBzZWxmLmdldEFsbFVUWE9TdHJpbmdzKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5kYi5zZXQocGVyc2lzdE9wdHMuZ2V0TmFtZSgpLCBkYXRhLCBwZXJzaXN0T3B0cy5nZXRPdmVyd3JpdGUoKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1dHhvcy5hZGRBcnJheShkYXRhKTtcbiAgICAgICAgICAgIHJldHVybiB1dHhvcztcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogSGVscGVyIGZ1bmN0aW9uIHdoaWNoIGNyZWF0ZXMgYW4gdW5zaWduZWQgdHJhbnNhY3Rpb24uIEZvciBtb3JlIGdyYW51bGFyIGNvbnRyb2wsIHlvdSBtYXkgY3JlYXRlIHlvdXIgb3duXG4gICAgICogW1tUeFVuc2lnbmVkXV0gbWFudWFsbHkgKHdpdGggdGhlaXIgY29ycmVzcG9uZGluZyBbW0lucHV0XV1zIGFuZCBbW091dHB1dF1dcy5cbiAgICAgKiBcbiAgICAgKiBAcGFyYW0gdXR4b3NldCBBIHNldCBvZiBVVFhPcyB0aGF0IHRoZSB0cmFuc2FjdGlvbiBpcyBidWlsdCBvblxu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lc3BvbnNlLmRhdGFbXCJyZXN1bHRcIl1bXCJ1dHhvc1wiXTtcbiAgICAgICAgICAgIGlmKHBlcnNpc3RPcHRzICYmIHR5cGVvZiBwZXJzaXN0T3B0cyA9PT0gJ29iamVjdCcpe1xuICAgICAgICAgICAgICAgIGlmKHRoaXMuZGIuaGFzKHBlcnNpc3RPcHRzLmdldE5hbWUoKSkpe1xuICAgICAgICAgICAgICAgICAgICBsZXQgc2VsZkFycmF5OkFycmF5PHN0cmluZz4gPSB0aGlzLmRiLmdldChwZXJzaXN0T3B0cy5nZXROYW1lKCkpO1xuICAgICAgICAgICAgICAgICAgICBpZihBcnJheS5pc0FycmF5KHNlbGZBcnJheSkpe1xuICAgICAgICAgICAgICAgICAgICAgICAgdXR4b3MuYWRkQXJyYXkoZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2VsZjpVVFhPU2V0ID0gbmV3IFVUWE9TZXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuYWRkQXJyYXkoc2VsZkFycmF5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYubWVyZ2VCeVJ1bGUodXR4b3MsIHBlcnNpc3RPcHRzLmdldE1lcmdlUnVsZSgpKVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IHNlbGYuZ2V0QWxsVVRYT1N0cmluZ3MoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLmRiLnNldChwZXJzaXN0T3B0cy5nZXROYW1lKCksIGRhdGEsIHBlcnNpc3RPcHRzLmdldE92ZXJ3cml0ZSgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHV0eG9zLmFkZEFycmF5KGRhdGEpO1xuICAgICAgICAgICAgcmV0dXJuIHV0eG9zO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBIZWxwZXIgZnVuY3Rpb24gd2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4ge1xuICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlLmRhdGFbXCJyZXN1bHRcIl1bXCJ0eElEXCJdO1xuICAgICAgICB9KTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogVGhpcyBjbGFzcyBzaG91bGQgbm90IGJlIGluc3RhbnRpYXRlZCBkaXJlY3RseS4gSW5zdGVhZCB1c2UgdGhlIFtbU2xvcGVzLmFkZEFQSV1dIG1ldGhvZC5cbiAgICAgKiBcbiAgICAgKiBAcGFyYW0gY29yZSBBIHJlZmVyZW5jZSB0byB0aGUgU2xvcGVzIGNsYXNzXG4gICAgICogQHBhcmFtIGJhc2V1cmwgRGVmYXVsdHMgdG8gdGhlIHN0cmluZyBcIi9leHQvYmMvYXZtXCIgYXMgdGhlIHBhdGggdG8gc3VibmV0cyBiYXNldXJsXG4gICAgICovXG4gICAgY29uc3RydWN0b3IoY29yZTpTbG9wZXNDb3JlLCBiYXNldXJsOnN0cmluZyA9IFwiL2V4dC9iYy9hdm1cIiwgYmxvY2tjaGFpbklEOnN0cmluZyA9IFwiXCIpeyBcbiAgICAgICAgc3VwZXIoY29yZSwgYmFzZXVybCk7XG4gICAgICAgIHRoaXMua2V5Y2hhaW4gPSBuZXcgQVZNS2V5Q2hhaW4oKTtcbiAgICAgICAgdGhpcy5ibG9ja2NoYWluSUQgPSBibG9ja2NoYWluSURcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IEFWTUFQSTsiXX0=

@@ -8,13 +8,2 @@ /**

/**
* Output:
*
* Output Payment:
* Amount | 08 bytes
* Locktime | 08 bytes
* Threshold | 04 bytes
* NumAddrs | 04 bytes
* Repeated (NumAddrs):
* Addr | 20 bytes
*/
/**
* Takes a buffer representing the output and returns the proper Output instance.

@@ -21,0 +10,0 @@ *

@@ -16,27 +16,2 @@ "use strict";

/**
* Output:
*
* Output Payment:
* Amount | 08 bytes
* Locktime | 08 bytes
* Threshold | 04 bytes
* NumAddrs | 04 bytes
* Repeated (NumAddrs):
* Addr | 20 bytes
*/
/* Output Take-or-Leave:
* OutputID | 04 bytes
* Amount | 08 bytes
* Locktime | 08 bytes
* Threshold | 04 bytes
* NumAddrs | 04 bytes
* Repeated (NumAddrs):
* Addr | 20 bytes
* FallLocktime | 08 bytes
* FallThreshold | 04 bytes
* NumFallAddrs | 04 bytes
* Repeated (NumFallAddrs):
* Addr | 20 bytes
*/
/**
* Takes a buffer representing the output and returns the proper Output instance.

@@ -322,2 +297,2 @@ *

exports.SecpOutput = SecpOutput;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0cHV0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcGlzL2F2bS9vdXRwdXRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUE7O0dBRUc7QUFDSCxvQ0FBK0I7QUFDL0Isb0VBQTRDO0FBQzVDLGtEQUF1QjtBQUN2QixtQ0FBc0Q7QUFFdEQsTUFBTSxRQUFRLEdBQUcsa0JBQVEsQ0FBQyxXQUFXLEVBQUUsQ0FBQztBQUV4QyxNQUFNLFFBQVEsR0FBRyxDQUFDLENBQUM7QUFFbkI7Ozs7Ozs7Ozs7R0FVRztBQUNIOzs7Ozs7Ozs7Ozs7O0dBYUc7QUFFSDs7Ozs7O0dBTUc7QUFDVSxRQUFBLGlCQUFpQixHQUFHLENBQUMsU0FBZ0IsRUFBRSxPQUFrQixFQUFFLEVBQVMsRUFBRTtJQUMvRSxJQUFJLE9BQU8sR0FBVSxRQUFRLENBQUMsUUFBUSxDQUFDLFNBQVMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUM7SUFDekQsSUFBSSxRQUFRLEdBQVUsU0FBUyxDQUFDLFlBQVksQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUNqRCxJQUFHLFFBQVEsSUFBSSxpQkFBUyxDQUFDLFlBQVksRUFB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XNzZXMpe1xuICAgICAgICAgICAgdGhpcy5hbW91bnRWYWx1ZSA9IGFtb3VudC5jbG9uZSgpO1xuICAgICAgICAgICAgdGhpcy5hbW91bnQgPSBiaW50b29scy5mcm9tQk5Ub0J1ZmZlcihhbW91bnQsIDgpO1xuICAgICAgICAgICAgbGV0IGFkZHJzOkFycmF5PEFkZHJlc3M+ID0gW107XG4gICAgICAgICAgICBmb3IobGV0IGkgPSAwOyBpIDwgYWRkcmVzc2VzLmxlbmd0aDsgaSsrKXtcbiAgICAgICAgICAgICAgICBhZGRyc1tpXSA9IG5ldyBBZGRyZXNzKCk7XG4gICAgICAgICAgICAgICAgYWRkcnNbaV0uZnJvbVN0cmluZyhhZGRyZXNzZXNbaV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5hZGRyZXNzZXMgPSBhZGRycztcbiAgICAgICAgICAgIHRoaXMuYWRkcmVzc2VzLnNvcnQoQWRkcmVzcy5jb21wYXJpdG9yKCkpO1xuICAgICAgICAgICAgdGhpcy5udW1hZGRycy53cml0ZVVJbnQzMkJFKHRoaXMuYWRkcmVzc2VzLmxlbmd0aCwgMCk7XG4gICAgICAgICAgICB0aGlzLnRocmVzaG9sZC53cml0ZVVJbnQzMkJFKCh0aHJlc2hvbGQgPyB0aHJlc2hvbGQgOiAxKSwgMCk7XG4gICAgICAgICAgICBpZighKGxvY2t0aW1lKSl7XG4gICAgICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgICAgICBsb2NrdGltZSA9IG5ldyBCTigwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMubG9ja3RpbWUgPSBiaW50b29scy5mcm9tQk5Ub0J1ZmZlcihsb2NrdGltZSwgOCk7XG4gICAgICAgIH1cbiAgICB9XG59XG5cblxuIl19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0cHV0cy5qcyIsInNvdXJjZV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ZmZlcihhbW91bnQsIDgpO1xuICAgICAgICAgICAgbGV0IGFkZHJzOkFycmF5PEFkZHJlc3M+ID0gW107XG4gICAgICAgICAgICBmb3IobGV0IGkgPSAwOyBpIDwgYWRkcmVzc2VzLmxlbmd0aDsgaSsrKXtcbiAgICAgICAgICAgICAgICBhZGRyc1tpXSA9IG5ldyBBZGRyZXNzKCk7XG4gICAgICAgICAgICAgICAgYWRkcnNbaV0uZnJvbVN0cmluZyhhZGRyZXNzZXNbaV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5hZGRyZXNzZXMgPSBhZGRycztcbiAgICAgICAgICAgIHRoaXMuYWRkcmVzc2VzLnNvcnQoQWRkcmVzcy5jb21wYXJpdG9yKCkpO1xuICAgICAgICAgICAgdGhpcy5udW1hZGRycy53cml0ZVVJbnQzMkJFKHRoaXMuYWRkcmVzc2VzLmxlbmd0aCwgMCk7XG4gICAgICAgICAgICB0aGlzLnRocmVzaG9sZC53cml0ZVVJbnQzMkJFKCh0aHJlc2hvbGQgPyB0aHJlc2hvbGQgOiAxKSwgMCk7XG4gICAgICAgICAgICBpZighKGxvY2t0aW1lKSl7XG4gICAgICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgICAgICBsb2NrdGltZSA9IG5ldyBCTigwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMubG9ja3RpbWUgPSBiaW50b29scy5mcm9tQk5Ub0J1ZmZlcihsb2NrdGltZSwgOCk7XG4gICAgICAgIH1cbiAgICB9XG59XG5cblxuIl19

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

}));
test('getAssetDescription', () => __awaiter(void 0, void 0, void 0, function* () {
test('getAssetDescription as string', () => __awaiter(void 0, void 0, void 0, function* () {
let assetid = "8a5d2d32e68bc50036e4d086044617fe4a0a0296b274999ba568ea92da46d533";

@@ -109,2 +109,20 @@ let result = api.getAssetDescription(assetid);

}));
test('getAssetDescription as Buffer', () => __awaiter(void 0, void 0, void 0, function* () {
let assetid = buffer_1.Buffer.from("8a5d2d32e68bc50036e4d086044617fe4a0a0296b274999ba568ea92da46d533");
let result = api.getAssetDescription(assetid);
let payload = {
"result": {
'name': "Collin Coin",
'symbol': 'CKC'
}
};
let responseObj = {
data: payload
};
jest_mock_axios_1.default.mockResponse(responseObj);
let response = yield result;
expect(jest_mock_axios_1.default.request).toHaveBeenCalledTimes(1);
expect(response["name"]).toBe("Collin Coin");
expect(response["symbol"]).toBe("CKC");
}));
test('getUTXOs', () => __awaiter(void 0, void 0, void 0, function* () {

@@ -278,2 +296,2 @@ //Payment

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi90ZXN0cy9hcGlzL2F2bS9hcGkudGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxzRUFBd0M7QUFDeEMsNkJBQTZCO0FBQzdCLHdEQUE4RDtBQUM5RCxvREFBZ0U7QUFDaEUsb0NBQStCO0FBQy9CLGtEQUF1QjtBQUN2QixrRUFBMEM7QUFDMUMsOENBQTZEO0FBQzdELGtEQUEwRDtBQUMxRCxnREFBdUQ7QUFDdkQsOERBQXFDO0FBRXJDLDhDQUE2QztBQUU3Qzs7R0FFRztBQUNILE1BQU0sUUFBUSxHQUFHLGtCQUFRLENBQUMsV0FBVyxFQUFFLENBQUM7QUFFeEMsUUFBUSxDQUFDLFFBQVEsRUFBRSxHQUFHLEVBQUU7SUFDcEIsTUFBTSxTQUFTLEdBQVUsRUFBRSxDQUFDO0lBQzVCLE1BQU0sWUFBWSxHQUFVLG1EQUFtRCxDQUFDO0lBQ2hGLE1BQU0sRUFBRSxHQUFVLFdBQVcsQ0FBQztJQUM5QixNQUFNLElBQUksR0FBVSxJQUFJLEN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0czpBcnJheTxTZWNwT3V0cHV0PjtcbiAgICAgICAgY29uc3QgYW1udDpudW1iZXIgPSAxMDAwMDtcbiAgICAgICAgbGV0IGFzc2V0SUQ6QnVmZmVyID0gQnVmZmVyLmZyb20oY3JlYXRlSGFzaChcInNoYTI1NlwiKS51cGRhdGUoXCJtYXJ5IGhhZCBhIGxpdHRsZSBsYW1iXCIpLmRpZ2VzdCgpKTtcbiAgICAgICAgXG4gICAgICAgIGJlZm9yZUVhY2goKCkgPT4ge1xuICAgICAgICAgICAgc2V0ID0gbmV3IFVUWE9TZXQoKTtcbiAgICAgICAgICAgIGFwaS5uZXdLZXlDaGFpbigpXG4gICAgICAgICAgICBrZXltZ3IyID0gbmV3IEFWTUtleUNoYWluKCk7XG4gICAgICAgICAgICBrZXltZ3IzID0gbmV3IEFWTUtleUNoYWluKCk7XG4gICAgICAgICAgICBhZGRyczEgPSBbXTtcbiAgICAgICAgICAgIGFkZHJzMiA9IFtdO1xuICAgICAgICAgICAgYWRkcnMzID0gW107XG4gICAgICAgICAgICB1dHhvcyA9IFtdO1xuICAgICAgICAgICAgaW5wdXRzID0gW107XG4gICAgICAgICAgICBvdXRwdXRzID0gW107XG5cblxuXG4gICAgICAgICAgICBmb3IobGV0IGk6bnVtYmVyID0gMDsgaSA8IDM7IGkrKyl7XG4gICAgICAgICAgICAgICAgYWRkcnMxLnB1c2goYXBpLmtleUNoYWluKCkubWFrZUtleSgpKTtcbiAgICAgICAgICAgICAgICBhZGRyczIucHVzaChrZXltZ3IyLm1ha2VLZXkoKSk7XG4gICAgICAgICAgICAgICAgYWRkcnMzLnB1c2goa2V5bWdyMy5tYWtlS2V5KCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGFtb3VudDpCTiA9IG5ldyBCTihhbW50KTtcbiAgICAgICAgICAgIGxldCBhZGRyZXNzZXM6QXJyYXk8c3RyaW5nPiA9IGFwaS5rZXlDaGFpbigpLmdldEFkZHJlc3NlcygpO1xuICAgICAgIC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IHV0eG9zLnB1c2godSk7XG4gICAgXG4gICAgICAgICAgICAgICAgdHhpZCA9IHUuZ2V0VHhJRCgpO1xuICAgICAgICAgICAgICAgIHR4aWR4ID0gdS5nZXRUeElkeCgpO1xuICAgICAgICAgICAgICAgIGxldCBhc3NldCA9IHUuZ2V0QXNzZXRJRCgpO1xuICAgIFxuICAgICAgICAgICAgICAgIGxldCBpbnB1dDpTZWNwSW5wdXQgPSBuZXcgU2VjcElucHV0KHR4aWQsIHR4aWR4LCBhbW91bnQsIGFzc2V0KTtcbiAgICAgICAgICAgICAgICBpbnB1dHMucHVzaChpbnB1dCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzZXQuYWRkQXJyYXkodXR4b3MpO1xuICAgICAgICB9KTtcblxuICAgICAgICB0ZXN0KCdtYWtlVW5zaWduZWRUeDEnLCAoKSA9PiB7XG4gICAgXG4gICAgICAgICAgICBsZXQgdHh1MTpUeFVuc2lnbmVkID0gYXBpLm1ha2VVbnNpZ25lZFR4KHNldCwgbmV3IEJOKGFtbnQpLCBhZGRyczMsIGFkZHJzMSwgYWRkcnMxLCBiaW50b29scy5hdmFTZXJpYWxpemUoYXNzZXRJRCkpO1xuICAgICAgICAgICAgbGV0IHR4dTI6VHhVbnNpZ25lZCA9IHNldC5tYWtlVW5zaWduZWRUeChcbiAgICAgICAgICAgICAgICBuZXR3b3JraWQsIGJpbnRvb2xzLmF2YURlc2VyaWFsaXplKGJsb2NrY2hhaW5pZCksIG5ldyBCTihhbW50KSwgXG4gICAgICAgICAgICAgICAgYWRkcnMzLCBhZGRyczEsIGFkZHJzMSwgYXNzZXRJRCwgXG4gICAgICAgICAgICAgICAgVW5peE5vdygpLCBuZXcgQk4oMCksIDFcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGV4cGVjdCh0eHUyLnRvQnVmZmVyKCkudG9TdHJpbmcoXCJoZXhcIikpLnRvQmUodHh1MS50b0J1ZmZlcigpLnRvU3RyaW5nKFwiaGV4XCIpKTtcbiAgICAgICAgICAgIGV4cGVjdCh0eHUyLnRvU3RyaW5nKCkpLnRvQmUodHh1MS50b1N0cmluZygpKTtcbiAgICAgICAgICAgIFxuICAgICAgICB9KTtcblxuICAgICAgICB0ZXN0KCdtYWtlVW5zaWduZWRUeDInLCAoKSA9PiB7XG4gICAgICAgICAgICBsZXQgdHh1MTpUeFVuc2lnbmVkID0gYXBpLm1ha2VVbnNpZ25lZFR4KHNldCwgbmV3IEJOKGFtbnQpLnN1YihuZXcgQk4oMTAwKSksIGFkZHJzMywgYWRkcnMxLCBhZGRyczIsIGJpbnRvb2xzLmF2YVNlcmlhbGl6ZShhc3NldElEKSk7XG4gICAgICAgICAgICBsZXQgdHh1MjpUeFVuc2lnbmVkID0gc2V0Lm1ha2VVbnNpZ25lZFR4KFxuICAgICAgICAgICAgICAgIG5ldHdvcmtpZCwgYmludG9vbHMuYXZhRGVzZXJpYWxpemUoYmxvY2tjaGFpbmlkKSwgbmV3IEJOKGFtbnQpLnN1YihuZXcgQk4oMTAwKSksIFxuICAgICAgICAgICAgICAgIGFkZHJzMywgYWRkcnMxLCBhZGRyczIsIGFzc2V0SUQsIFxuICAgICAgICAgICAgICAgIFVuaXhOb3coKSwgbmV3IEJOKDApLCAxXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBleHBlY3QodHh1Mi50b0J1ZmZlcigpLnRvU3RyaW5nKFwiaGV4XCIpKS50b0JlKHR4dTEudG9CdWZmZXIoKS50b1N0cmluZyhcImhleFwiKSk7XG4gICAgICAgICAgICBleHBlY3QodHh1Mi50b1N0cmluZygpKS50b0JlKHR4dTEudG9TdHJpbmcoKSk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGxldCBvdXRpZXMgPSB0eHUxLmdldE91dHMoKS5zb3J0KFNlY3BPdXRwdXQuY29tcGFyYXRvcigpKSBhcyBBcnJheTxTZWNwT3V0cHV0PjtcblxuICAgICAgICAgICAgZXhwZW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ZlcigpKTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkOm9iamVjdCA9IHtcbiAgICAgICAgICAgICAgICBcInJlc3VsdFwiOiB7XG4gICAgICAgICAgICAgICAgICAgICd0eElEJzogdHhpZFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2VPYmogPSB7XG4gICAgICAgICAgICAgICAgZGF0YTogcGF5bG9hZFxuICAgICAgICAgICAgfTtcbiAgICBcbiAgICAgICAgICAgIG1vY2tBeGlvcy5tb2NrUmVzcG9uc2UocmVzcG9uc2VPYmopO1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlOnN0cmluZyA9IGF3YWl0IHJlc3VsdDtcbiAgICBcbiAgICAgICAgICAgIGV4cGVjdChtb2NrQXhpb3MucmVxdWVzdCkudG9IYXZlQmVlbkNhbGxlZFRpbWVzKDEpO1xuICAgICAgICAgICAgZXhwZWN0KHJlc3BvbnNlKS50b0JlKHR4aWQpO1xuICAgICAgICB9KTtcblxuICAgICAgICB0ZXN0KCdpc3N1ZVR4IENsYXNzIFR4JywgYXN5bmMgKCk9PntcbiAgICAgICAgICAgIGxldCB0eHU6VHhVbnNpZ25lZCA9IGFwaS5tYWtlVW5zaWduZWRUeChzZXQsIG5ldyBCTihhbW50KSwgYWRkcnMzLCBhZGRyczEsIGFkZHJzMSwgYmludG9vbHMuYXZhU2VyaWFsaXplKGFzc2V0SUQpKTtcbiAgICAgICAgICAgIGxldCB0eCA9IGFwaS5zaWduVHgodHh1KTtcblxuICAgICAgICAgICAgbGV0IHR4aWQ6c3RyaW5nID0gXCJmOTY2NzUwZjQzODg2N2MzYzk4MjhkZGNkYmU2NjBlMjFjY2RiYjM2YTkyNzY5NThmMDExYmE0NzJmNzVkNGU3XCI7XG4gICAgXG4gICAgICAgICAgICBsZXQgcmVzdWx0OlByb21pc2U8c3RyaW5nPiA9IGFwaS5pc3N1ZVR4KHR4KTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkOm9iamVjdCA9IHtcbiAgICAgICAgICAgICAgICBcInJlc3VsdFwiOiB7XG4gICAgICAgICAgICAgICAgICAgICd0eElEJzogdHhpZFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2VPYmogPSB7XG4gICAgICAgICAgICAgICAgZGF0YTogcGF5bG9hZFxuICAgICAgICAgICAgfTtcbiAgICBcbiAgICAgICAgICAgIG1vY2tBeGlvcy5tb2NrUmVzcG9uc2UocmVzcG9uc2VPYmopO1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlOnN0cmluZyA9IGF3YWl0IHJlc3VsdDtcbiAgICBcbiAgICAgICAgICAgIGV4cGVjdChtb2NrQXhpb3MucmVxdWVzdCkudG9IYXZlQmVlbkNhbGxlZFRpbWVzKDEpO1xuICAgICAgICAgICAgZXhwZWN0KHJlc3BvbnNlKS50b0JlKHR4aWQpO1xuICAgICAgICB9KTtcblxuICAgIH0pO1xuICAgIFxuXG59KTsiXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi90ZXN0cy9hcGlzL2F2bS9hcGkudGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxzRUFBd0M7QUFDeEMsNkJBQTZCO0FBQzdCLHdEQUE4RDtBQUM5RCxvREFBZ0U7QUFDaEUsb0NBQStCO0FBQy9CLGtEQUF1QjtBQUN2QixrRUFBMEM7QUFDMUMsOENBQTZEO0FBQzdELGtEQUEwRDtBQUMxRCxnREFBdUQ7QUFDdkQsOERBQXFDO0FBRXJDLDhDQUE2QztBQUU3Qzs7R0FFRztBQUNILE1BQU0sUUFBUSxHQUFHLGtCQUFRLENBQUMsV0FBVyxFQ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OkJ1ZmZlciA9IEJ1ZmZlci5mcm9tKGNyZWF0ZUhhc2goXCJzaGEyNTZcIikudXBkYXRlKFwibWFyeSBoYWQgYSBsaXR0bGUgbGFtYlwiKS5kaWdlc3QoKSk7XG4gICAgICAgIFxuICAgICAgICBiZWZvcmVFYWNoKCgpID0+IHtcbiAgICAgICAgICAgIHNldCA9IG5ldyBVVFhPU2V0KCk7XG4gICAgICAgICAgICBhcGkubmV3S2V5Q2hhaW4oKVxuICAgICAgICAgICAga2V5bWdyMiA9IG5ldyBBVk1LZXlDaGFpbigpO1xuICAgICAgICAgICAga2V5bWdyMyA9IG5ldyBBVk1LZXlDaGFpbigpO1xuICAgICAgICAgICAgYWRkcnMxID0gW107XG4gICAgICAgICAgICBhZGRyczIgPSBbXTtcbiAgICAgICAgICAgIGFkZHJzMyA9IFtdO1xuICAgICAgICAgICAgdXR4b3MgPSBbXTtcbiAgICAgICAgICAgIGlucHV0cyA9IFtdO1xuICAgICAgICAgICAgb3V0cHV0cyA9IFtdO1xuXG5cblxuICAgICAgICAgICAgZm9yKGxldCBpOm51bWJlciA9IDA7IGkgPCAzOyBpKyspe1xuICAgICAgICAgICAgICAgIGFkZHJzMS5wdXNoKGFwaS5rZXlDaGFpbigpLm1ha2VLZXkoKSk7XG4gICAgICAgICAgICAgICAgYWRkcnMyLnB1c2goa2V5bWdyMi5tYWtlS2V5KCkpO1xuICAgICAgICAgICAgICAgIGFkZHJzMy5wdXNoKGtleW1ncjMubWFrZUtleSgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhbW91bnQ6Qk4gPSBuZXcgQk4oYW1udCk7XG4gICAgICAgICAgICBsZXQgYWRkcmVzc2VzOkFycmF5PHN0cmluZz4gPSBhcGkua2V5Q2hhaW4oKS5nZXRBZGRyZXNzZXMoKTtcbiAgICAgICAgICAgIGxldCBmYWxsQWRkcmVzc2VzOkFycmF5PHN0cmluZz4gPSBrZXltZ3IyLmdldEFkZHJlc3NlcygpXG4g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ICAgICAgICAgICB0eGlkeCA9IHUuZ2V0VHhJZHgoKTtcbiAgICAgICAgICAgICAgICBsZXQgYXNzZXQgPSB1LmdldEFzc2V0SUQoKTtcbiAgICBcbiAgICAgICAgICAgICAgICBsZXQgaW5wdXQ6U2VjcElucHV0ID0gbmV3IFNlY3BJbnB1dCh0eGlkLCB0eGlkeCwgYW1vdW50LCBhc3NldCk7XG4gICAgICAgICAgICAgICAgaW5wdXRzLnB1c2goaW5wdXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2V0LmFkZEFycmF5KHV0eG9zKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgdGVzdCgnbWFrZVVuc2lnbmVkVHgxJywgKCkgPT4ge1xuICAgIFxuICAgICAgICAgICAgbGV0IHR4dTE6VHhVbnNpZ25lZCA9IGFwaS5tYWtlVW5zaWduZWRUeChzZXQsIG5ldyBCTihhbW50KSwgYWRkcnMzLCBhZGRyczEsIGFkZHJzMSwgYmludG9vbHMuYXZhU2VyaWFsaXplKGFzc2V0SUQpKTtcbiAgICAgICAgICAgIGxldCB0eHUyOlR4VW5zaWduZWQgPSBzZXQubWFrZVVuc2lnbmVkVHgoXG4gICAgICAgICAgICAgICAgbmV0d29ya2lkLCBiaW50b29scy5hdmFEZXNlcmlhbGl6ZShibG9ja2NoYWluaWQpLCBuZXcgQk4oYW1udCksIFxuICAgICAgICAgICAgICAgIGFkZHJzMywgYWRkcnMxLCBhZGRyczEsIGFzc2V0SUQsIFxuICAgICAgICAgICAgICAgIFVuaXhOb3coKSwgbmV3IEJOKDApLCAxXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBleHBlY3QodHh1Mi50b0J1ZmZlcigpLnRvU3RyaW5nKFwiaGV4XCIpKS50b0JlKHR4dTEudG9CdWZmZXIoKS50b1N0cmluZyhcImhleFwiKSk7XG4gICAgICAgICAgICBleHBlY3QodHh1Mi50b1N0cmluZygpKS50b0JlKHR4dTEudG9TdHJpbmcoKSk7XG4gICAgICAgICAgICBcbiAgICAgICAgfSk7XG5cbiAgICAgICAgdGVzdCgnbWFrZVVuc2lnbmVkVHgyJywgKCkgPT4ge1xuICAgICAgICAgICAgbGV0IHR4dTE6VHhVbnNpZ25lZCA9IGFwaS5tYWtlVW5zaWduZWRUeChzZXQsIG5ldyBCTihhbW50KS5zdWIobmV3IEJOKDEwMCkpLCBhZGRyczMsIGFkZHJzMSwgYWRkcnMyLCBiaW50b29scy5hdmFTZXJpYWxpemUoYXNzZXRJRCkpO1xuICAgICAgICAgICAgbGV0IHR4dTI6VHhVbnNpZ25lZCA9IHNldC5tYWtlVW5zaWduZWRUeChcbiAgICAgICAgICAgICAgICBuZXR3b3JraWQsIGJpbnRvb2xzLmF2YURlc2VyaWFsaXplKGJsb2NrY2hhaW5pZCksIG5ldyBCTihhbW50KS5zdWIobmV3IEJOKDEwMCkpLCBcbiAgICAgICAgICAgICAgICBhZGRyczMsIGFkZHJzMSwgYWRkcnMyLCBhc3NldElELCBcbiAgICAgICAgICAgICAgICBVbml4Tm93KCksIG5ldyBCTigwKSwgMVxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgZXhwZWN0KHR4dTIudG9CdWZmZXIoKS50b1N0cmluZyhcImhleFwiKSkudG9CZSh0eHUxLnRvQnVmZmVyKCkudG9TdHJpbmcoXCJoZXhcIikpO1xuICAgICAgICAgICAgZXhwZWN0KHR4dTIudG9TdHJpbmcoKSkudG9CZSh0eHUxLnRvU3RyaW5nKCkpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBsZXQgb3V0aWVzID0gdHh1MS5nZXRPdXRzKCkuc29ydChTZWNwT3V0cHV0LmNvbXBhcmF0b3IoKSkgYXMgQXJyYXk8U2VjcE91dHB1dD47XG5cbiAgICAgICAgICAgIGV4cGVjdChvdXRpZXMubGVuZ3RoKS50b0JlKDIpO1xuICAgICAgICAgICAgbGV0IG91dGFkZHIwID0gT2JqZWN0LmtleXMob3V0a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uICAgICAgICAgICAgICAgICAgICAndHhJRCc6IHR4aWRcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlT2JqID0ge1xuICAgICAgICAgICAgICAgIGRhdGE6IHBheWxvYWRcbiAgICAgICAgICAgIH07XG4gICAgXG4gICAgICAgICAgICBtb2NrQXhpb3MubW9ja1Jlc3BvbnNlKHJlc3BvbnNlT2JqKTtcbiAgICAgICAgICAgIGxldCByZXNwb25zZTpzdHJpbmcgPSBhd2FpdCByZXN1bHQ7XG4gICAgXG4gICAgICAgICAgICBleHBlY3QobW9ja0F4aW9zLnJlcXVlc3QpLnRvSGF2ZUJlZW5DYWxsZWRUaW1lcygxKTtcbiAgICAgICAgICAgIGV4cGVjdChyZXNwb25zZSkudG9CZSh0eGlkKTtcbiAgICAgICAgfSk7XG5cbiAgICB9KTtcbiAgICBcblxufSk7Il19

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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