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

rods

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rods - npm Package Compare versions

Comparing version 1.0.0-beta to 1.1.0-beta

13

lib/model.js
var async = require('async');
var table = function(obj) {
var model = function(obj) {
this._isNew = obj._isNew || true;

@@ -9,3 +9,10 @@ Object.assign(this, obj);

table.prototype.save = function(args, callback) {
model.prototype.toObject = function() {
var o = Object.assign({}, this);
delete o._original;
delete o._isNew;
return o;
}
model.prototype.save = function(args, callback) {
var self = this;

@@ -71,3 +78,3 @@ var o = Object.assign({}, self);

module.exports = table;
module.exports = model;
module.exports.new = function(name) {

@@ -74,0 +81,0 @@ var self = this;

{
"name": "rods",
"version": "1.0.0-beta",
"version": "1.1.0-beta",
"description": "a micro ORM using knex",

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

@@ -59,2 +59,3 @@ var assert = require('assert');

assert(u._isNew);
console.log(u);
assert.equal(u.name, 'bob');

@@ -81,2 +82,14 @@ });

});
describe('.toObject', function() {
it('should return the raw object', function(done) {
db.user.get(1, function(err, u) {
var o = u.toObject();
assert.equal(o.id, 1);
assert.equal(o.name, 'bob');
assert.equal(o.created_at, null);
assert.equal(o.updated_at, null);
done();
});
});
});
describe('.fetch', function() {

@@ -83,0 +96,0 @@ it('should fetch users', function(done) {

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