New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lite-model

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lite-model - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

18

lib/model.ts

@@ -52,5 +52,16 @@ import Sqlite from 'better-sqlite3';

attr(name: string, value: any): void {
this._attributes[name] = value;
if (this._attributes[name] !== value) {
this._attributes[name] = value;
}
}
getAttr(name: string): any {
return this._attributes[name];
}
change(name: string, value: any): void {
this.attr(name, value);
this._changed[name] = value;
}
clone(): Model {

@@ -66,6 +77,6 @@ return new (this.constructor as new (options: ModelOpts) => this)(this._options as ModelOpts)

set: (value: any) => {
instance.attr(key, value);
instance.change(key, value);
},
get: () => {
return instance._attributes[key];
return instance.getAttr(key);
}

@@ -142,3 +153,2 @@ });

const { sql, params } = builder.table(this._table).insert(data);
console.log(sql, params);
const { lastInsertRowid } = this.db.prepare(sql).run(...params);

@@ -145,0 +155,0 @@ return this.findById(lastInsertRowid);

{
"name": "lite-model",
"version": "0.0.5",
"version": "0.0.6",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "scripts": {

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