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

swdc-tracker

Package Overview
Dependencies
Maintainers
5
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swdc-tracker - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

16

dist/utils/hash.js

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

return __awaiter(this, void 0, void 0, function () {
var hashedValue, hashValueAlreadyExists;
var hashedValue;
return __generator(this, function (_a) {

@@ -66,10 +66,6 @@ switch (_a.label) {

hashedValue = sodium.to_hex(sodium.crypto_generichash(64, value));
hashValueAlreadyExists = !!userHashedValues[dataType] && userHashedValues[dataType].includes(hashedValue);
if (!!hashValueAlreadyExists) return [3 /*break*/, 4];
return [4 /*yield*/, encryptValue(value, hashedValue, dataType, jwt)];
case 3:
_a.sent();
setUserHashedValues(jwt);
_a.label = 4;
case 4: return [2 /*return*/, hashedValue];
return [2 /*return*/, hashedValue];
}

@@ -82,3 +78,3 @@ });

return __awaiter(this, void 0, void 0, function () {
var params, response;
var hashValueAlreadyExists, params, response;
return __generator(this, function (_a) {

@@ -90,2 +86,4 @@ switch (_a.label) {

}
hashValueAlreadyExists = !!userHashedValues[dataType] && userHashedValues[dataType].includes(hashedValue);
if (!!hashValueAlreadyExists) return [3 /*break*/, 2];
params = {

@@ -108,3 +106,5 @@ value: value,

}
return [2 /*return*/];
setUserHashedValues(jwt);
_a.label = 2;
case 2: return [2 /*return*/];
}

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

{
"name": "swdc-tracker",
"version": "1.2.4",
"version": "1.2.5",
"description": "swdc event tracker",

@@ -5,0 +5,0 @@ "main": "dist",

@@ -25,9 +25,4 @@ import { get, post } from "./http";

const hashValueAlreadyExists = !!userHashedValues[dataType] && userHashedValues[dataType].includes(hashedValue);
await encryptValue(value, hashedValue, dataType, jwt);
if (!hashValueAlreadyExists) {
await encryptValue(value, hashedValue, dataType, jwt);
setUserHashedValues(jwt);
}
return hashedValue;

@@ -41,16 +36,23 @@ }

const params = {
value: value,
hashed_value: hashedValue,
data_type: dataType
}
const hashValueAlreadyExists = !!userHashedValues[dataType] && userHashedValues[dataType].includes(hashedValue);
const response = await post("/user_encrypted_data", params, jwt);
if(response.status == 201) {
// update the local userHashedValues so that we don't re-encrypt it
if(userHashedValues[dataType]) {
userHashedValues[dataType].push(hashedValue);
} else {
userHashedValues[dataType] = [hashedValue]
if(!hashValueAlreadyExists) {
const params = {
value: value,
hashed_value: hashedValue,
data_type: dataType
}
const response = await post("/user_encrypted_data", params, jwt);
if(response.status == 201) {
// update the local userHashedValues so that we don't re-encrypt it
if(userHashedValues[dataType]) {
userHashedValues[dataType].push(hashedValue);
} else {
userHashedValues[dataType] = [hashedValue]
}
}
setUserHashedValues(jwt);
}

@@ -57,0 +59,0 @@ }

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