Comparing version 2.1.3 to 2.1.4
@@ -16,2 +16,3 @@ # Verse.db [Beta] | ||
- Fixed Unique Keys for add method and schema | ||
- Fixed remove method in JSON/Yaml adapter. | ||
@@ -18,0 +19,0 @@ ## Version v2.0 |
@@ -34,3 +34,3 @@ /// <reference types="node" /> | ||
}): void; | ||
nearbyVectors(data: nearbyOptions): Promise<AdapterResults>; | ||
nearbyVectors(data?: nearbyOptions): Promise<AdapterResults>; | ||
calculateDistance(point1: any, point2: any): number; | ||
@@ -55,2 +55,6 @@ degToRad(degrees: number): number; | ||
pipline?: any; | ||
geometry?: any; | ||
bufferDistance?: any; | ||
polygonCoordinates?: any; | ||
data?: nearbyOptions; | ||
}>): Promise<AdapterResults>; | ||
@@ -57,0 +61,0 @@ aggregate(dataname: string, pipeline: any[]): Promise<AdapterResults>; |
@@ -34,3 +34,3 @@ /// <reference types="node" /> | ||
}): void; | ||
nearbyVectors(data: nearbyOptions): Promise<AdapterResults>; | ||
nearbyVectors(data?: nearbyOptions): Promise<AdapterResults>; | ||
calculateDistance(point1: any, point2: any): number; | ||
@@ -37,0 +37,0 @@ degToRad(degrees: number): number; |
@@ -16,2 +16,3 @@ export declare const opSet: (doc: any, update: any) => void; | ||
export declare const opSort: (doc: any, update: any, upsert?: boolean) => void; | ||
export declare function isEqual(a: any, b: any): boolean; | ||
//# sourceMappingURL=operations.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.opSort = exports.opSlice = exports.opCurrentDate = exports.opPop = exports.opBit = exports.opInc = exports.opMul = exports.opMax = exports.opMin = exports.opAddToSet = exports.opRename = exports.opPull = exports.opPush = exports.opUnset = exports.opSet = void 0; | ||
exports.isEqual = exports.opSort = exports.opSlice = exports.opCurrentDate = exports.opPop = exports.opBit = exports.opInc = exports.opMul = exports.opMax = exports.opMin = exports.opAddToSet = exports.opRename = exports.opPull = exports.opPush = exports.opUnset = exports.opSet = void 0; | ||
const opSet = (doc, update) => { | ||
@@ -829,2 +829,36 @@ for (const key in update) { | ||
exports.opSort = opSort; | ||
function isEqual(a, b) { | ||
if (a === b) { | ||
return true; | ||
} | ||
if (a == null || b == null) { | ||
return false; | ||
} | ||
if (typeof a === 'object' && typeof b === 'object') { | ||
const keysA = Object.keys(a); | ||
const keysB = Object.keys(b); | ||
if (keysA.length !== keysB.length) { | ||
return false; | ||
} | ||
for (const key of keysA) { | ||
if (!isEqual(a[key], b[key])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
if (Array.isArray(a) && Array.isArray(b)) { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
for (let i = 0; i < a.length; i++) { | ||
if (!isEqual(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isEqual = isEqual; | ||
//# sourceMappingURL=operations.js.map |
@@ -31,2 +31,8 @@ "use strict"; | ||
const errors = {}; | ||
// Check for extra fields not defined in the schema | ||
for (const key in data) { | ||
if (!this.fields.hasOwnProperty(key)) { | ||
errors[key] = `Field '${key}' is not defined in the schema.`; | ||
} | ||
} | ||
for (const field in this.fields) { | ||
@@ -33,0 +39,0 @@ const fieldConfig = this.fields[field]; |
import { encodeJSON, decodeJSON, encodeYAML, decodeYAML, encodeSQL, decodeSQL, neutralizer, genObjectId } from "./core/functions/secureData"; | ||
import { verseManagers, Connect } from "./types/versedb.types"; | ||
import { verseManagers, Connector } from "./types/versedb.types"; | ||
import connect from "./core/connect"; | ||
@@ -81,4 +81,4 @@ import { randomID, randomUUID } from "./lib/id"; | ||
}; | ||
export { connect, randomID, randomUUID, logger, Schema, verseParser, SchemaTypes, colors, neutralizer, genObjectId, Connect, verseManagers, }; | ||
export { connect, randomID, randomUUID, logger, Schema, verseParser, SchemaTypes, colors, neutralizer, genObjectId, Connector, verseManagers, }; | ||
export default versedb; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -23,2 +23,3 @@ export interface DisplayOptions { | ||
groupBy?: any; | ||
split?: number; | ||
} | ||
@@ -25,0 +26,0 @@ export interface AdapterUniqueKey { |
import { JSONAdapter, SQLAdapter, YAMLAdapter } from "./connect"; | ||
export interface Connect { | ||
export interface Connector { | ||
adapter: 'json' | 'yaml' | 'sql' | string; | ||
@@ -11,3 +11,3 @@ dataPath: string; | ||
enable: boolean; | ||
secret?: string; | ||
secret: string; | ||
}; | ||
@@ -14,0 +14,0 @@ backup?: any; |
{ | ||
"name": "verse.db", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"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 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 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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
713951
9294