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

sedentary

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sedentary - npm Package Compare versions

Comparing version 0.0.31 to 0.0.32

5

dist/cjs/db.js

@@ -16,5 +16,10 @@ "use strict";

postLoad() { }
postRemove() { }
postSave() { }
preLoad() { }
preRemove() { }
preSave() { }
async remove() {
return false;
}
async save() {

@@ -21,0 +26,0 @@ return false;

@@ -452,2 +452,13 @@ "use strict";

Object.assign(ret.prototype, methods);
const remove = this.db.remove(tableName, pk);
ret.prototype.remove = async function () {
if (!this.loaded)
throw new Error(`${modelName}.remove: Can't remove a never saved Entry`);
this.preRemove();
const ret = await remove.call(this);
if (ret)
this.postRemove();
return ret;
};
Object.defineProperty(ret.prototype.remove, "name", { value: modelName + ".remove" });
const save = this.db.save(tableName, attr2field, pk);

@@ -454,0 +465,0 @@ ret.prototype.save = async function () {

@@ -13,5 +13,10 @@ export class EntryBase {

postLoad() { }
postRemove() { }
postSave() { }
preLoad() { }
preRemove() { }
preSave() { }
async remove() {
return false;
}
async save() {

@@ -18,0 +23,0 @@ return false;

@@ -446,2 +446,13 @@ import { Attribute, EntryBase, Table, Transaction, Type } from "./db";

Object.assign(ret.prototype, methods);
const remove = this.db.remove(tableName, pk);
ret.prototype.remove = async function () {
if (!this.loaded)
throw new Error(`${modelName}.remove: Can't remove a never saved Entry`);
this.preRemove();
const ret = await remove.call(this);
if (ret)
this.postRemove();
return ret;
};
Object.defineProperty(ret.prototype.remove, "name", { value: modelName + ".remove" });
const save = this.db.save(tableName, attr2field, pk);

@@ -448,0 +459,0 @@ ret.prototype.save = async function () {

4

dist/types/db.d.ts

@@ -6,5 +6,8 @@ export declare type Natural = Date | Record<string, unknown> | boolean | number | string | null;

postLoad(): void;
postRemove(): void;
postSave(): void;
preLoad(): void;
preRemove(): void;
preSave(): void;
remove(): Promise<boolean>;
save(): Promise<boolean>;

@@ -89,2 +92,3 @@ }

abstract load(tableName: string, attributes: Record<string, string>, pk: Attribute<Natural, unknown>, model: new () => EntryBase, table: Table): (where: string, order?: string[], tx?: Transaction, lock?: boolean) => Promise<EntryBase[]>;
abstract remove(tableName: string, pk: Attribute<Natural, unknown>): (this: EntryBase & Record<string, Natural>) => Promise<boolean>;
abstract save(tableName: string, attributes: Record<string, string>, pk: Attribute<Natural, unknown>): (this: EntryBase & Record<string, Natural>) => Promise<boolean>;

@@ -91,0 +95,0 @@ abstract dropConstraints(table: Table): Promise<number[]>;

2

package.json

@@ -82,3 +82,3 @@ {

"types": "./dist/types/index.d.ts",
"version": "0.0.31"
"version": "0.0.32"
}
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