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

chia-changelist-generator

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chia-changelist-generator - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

.history/index_20240520084018.js

27

index.js

@@ -23,3 +23,3 @@ const Datalayer = require("chia-datalayer");

const isValidHexadecimal = (value) => {
const isValidHexadecimal = (value) => {
if (value?.startsWith("0x")) {

@@ -37,8 +37,11 @@ value = value.slice(2);

if (action == 'insert' && !isValidHexadecimal(value)) {
throw new Error(
`Value for ${key} is not a valid hexadecimal string`
);
if (action == "insert" && !isValidHexadecimal(value)) {
throw new Error(`Value for ${key} is not a valid hexadecimal string`);
}
// Update doesnt require knowledge of existing keys
if (action === "upsert") {
return generateUpsertChange(key, value);
}
const existingKeys = await datalayer.getKeys({ id: storeId });

@@ -55,2 +58,16 @@

const generateUpsertChange = async (existingKeys, key) => {
const change = [];
console.log(`Upsert: Key ${decodeHex(key)}`);
change.push({
action: "upsert",
key: key,
value: value,
});
return change;
};
const generateInsertChange = (existingKeys, key, value) => {

@@ -57,0 +74,0 @@ const change = [];

6

package.json
{
"name": "chia-changelist-generator",
"version": "1.0.9",
"version": "1.0.10",
"description": "Easily Generate a ChangeList for Chia DataLayer",

@@ -23,5 +23,5 @@ "main": "index.js",

"dependencies": {
"chia-changelist-chunks": "^1.0.16",
"chia-datalayer": "^2.0.10"
"chia-changelist-chunks": "^1.0.13",
"chia-datalayer": "^2.0.9"
}
}
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