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

verse.db

Package Overview
Dependencies
Maintainers
0
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

verse.db - npm Package Compare versions

Comparing version 2.2.13 to 2.2.14

62

dist/core/functions/operations.js

@@ -12,42 +12,30 @@ "use strict";

const path_1 = __importDefault(require("path"));
function setValueByPath(obj, path, value) {
const parts = path.split('.');
const lastPart = parts.pop();
const target = parts.reduce((acc, part) => {
var _a;
const match = part.match(/(\w+)\[(\d+)\]/);
if (match) {
const [, key, index] = match;
if (!acc[key]) {
acc[key] = [];
}
return (_a = acc[key][index]) !== null && _a !== void 0 ? _a : (acc[key][index] = {});
}
else {
if (!acc[part]) {
acc[part] = {};
}
return acc[part];
}
}, obj);
if (lastPart !== undefined) {
target[lastPart] = value;
}
}
const opSet = (doc, update) => {
for (const key in update) {
if (update.hasOwnProperty(key)) {
if (key.includes('[') && key.includes(']')) {
const parts = key.split(/[\[\].]+/).filter(Boolean);
let target = doc;
while (parts.length > 1) {
const part = parts.shift();
if (part !== undefined) {
if (!target[part]) {
target[part] = isNaN(Number(parts[0])) ? {} : [];
}
target = target[part];
}
}
const lastPart = parts[0];
if (lastPart !== undefined) {
target[lastPart] = update[key];
}
}
else if (typeof update[key] === 'object' && !Array.isArray(update[key])) {
const parts = key.split('.');
let target = doc;
while (parts.length > 1) {
const part = parts.shift();
if (part !== undefined) {
if (!target[part]) {
target[part] = {};
}
target = target[part];
}
}
const lastPart = parts[0];
if (lastPart !== undefined) {
target[lastPart] = { ...target[lastPart], ...update[key] };
}
}
else {
doc[key] = update[key];
}
setValueByPath(doc, key, update[key]);
}

@@ -54,0 +42,0 @@ }

{
"name": "verse.db",
"version": "2.2.13",
"version": "2.2.14",
"description": "verse.db isn't just a database, it's your universal data bridge. Designed for unmatched flexibility, security, and performance, verse.db empowers you to manage your data with ease.",

@@ -5,0 +5,0 @@ "license": "MIT",

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