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.7 to 1.0.8

.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 === "update") {
return generateUpdateChange(key, value);
}
const existingKeys = await datalayer.getKeys({ id: storeId });

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

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

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

2

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

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

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