Socket
Socket
Sign inDemoInstall

swift-database

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.1.0

4

dist/classes/DatabaseTable.d.ts

@@ -15,3 +15,3 @@ import JSONFile from './JSONFile';

*/
getAll(): TableDocument[];
get all(): TableDocument[];
/**

@@ -98,4 +98,4 @@ * → Get a document by its id

*/
push(documentId: string, propertyKey: string, value: any): TableDocument;
push(documentId: string, propertyKey: string, ...items: any[]): TableDocument;
}
export {};

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

get size() {
return this.getAll().length;
return this.all.length;
}

@@ -25,3 +25,3 @@ /**

*/
getAll() {
get all() {
const documentsData = this._file.data[this.name];

@@ -43,3 +43,3 @@ return documentsData.map((documentData) => new TableDocument_1.default(documentData));

findOne(predicate) {
return this.getAll().find(predicate);
return this.all.find(predicate);
}

@@ -51,3 +51,3 @@ /**

findMany(predicate) {
return this.getAll().filter(predicate);
return this.all.filter(predicate);
}

@@ -242,3 +242,3 @@ /**

*/
push(documentId, propertyKey, value) {
push(documentId, propertyKey, ...items) {
const documentToUpdate = this.getById(documentId);

@@ -252,4 +252,4 @@ if (!documentToUpdate)

const fileData = this._file.data;
fileData[this.name].find((documentData) => documentData._id === documentToUpdate.id)[propertyKey].push(value);
documentToUpdate.value[propertyKey].push(value);
fileData[this.name].find((documentData) => documentData._id === documentToUpdate.id)[propertyKey].push(items);
documentToUpdate.value[propertyKey].push(items);
this._file.updateData(fileData);

@@ -256,0 +256,0 @@ return documentToUpdate;

{
"name": "swift-database",
"version": "1.0.0",
"version": "1.1.0",
"description": "A light-weight module to interact with your local JSON database.",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc