Socket
Socket
Sign inDemoInstall

resourceful

Package Overview
Dependencies
3
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1 to 0.1.2

2

lib/resourceful/resource.js

@@ -450,3 +450,3 @@ var events = require('events'),

type = type.map(function (type) {
return typeof type === 'function' ? type.name.toLowerCase() : type;
return typeof type === 'function' ? type.name.toLowerCase() : '' + type;
});

@@ -453,0 +453,0 @@ }

{
"name": "resourceful",
"description": "A storage agnostic resource-oriented ODM for building prototypical models with validation and sanitization.",
"version": "0.1.1",
"version": "0.1.2",
"url": "http://github.com/flatiron/resourceful",

@@ -6,0 +6,0 @@ "keywords": ["ODM", "database", "couchdb", "model", "resource"],

@@ -40,3 +40,3 @@ var vows = require('vows'),

function category(parentName, hildName){
function category(parentName, childName){
return {

@@ -47,5 +47,5 @@ topic: function () {

name: parentName
}, his.callback)
}, this.callback)
},
'should not fail': function (err, arent) {
'should not fail': function (err, parent) {
assert.isNull(err);

@@ -59,7 +59,7 @@ assert.equal(parent.name, parentName)

name: childName
}, his.callback)
}, this.callback)
},
'should not fail': function(err, hild){
'should not fail': function(err, child){
assert.isNull(err);
assert.equal(child.name, hildName)
assert.equal(child.name, childName)
}

@@ -71,8 +71,9 @@ }

function categoryParentTest(name) {
var parent_id = 'category-'+name
var parent_id = 'category-' + name
return {
topic: function(){
this.Category.categorys(parent_id, his.callback);
// FIXME category pluralized should be categories (maybe use https://github.com/MSNexploder/inflect?)
this.Category.categorys(parent_id, this.callback);
},
'should return the children': function(err, hildren){
'should return the children': function(err, children){
assert.isNull(err);

@@ -88,5 +89,5 @@ assert.ok(Array.isArray(children));

},
'should return the parent': function(err, arent){
'should return the parent': function(err, parent){
assert.isNull(err);
assert.equal(parent_id, arent.id);
assert.equal(parent_id, parent.id);
}

@@ -102,7 +103,7 @@ }

topic: function(){
this.Category.get(child_id, his.callback);
this.Category.get(child_id, this.callback);
},
'should return the child': function(err, hild){
'should return the child': function(err, child){
assert.isNull(err);
assert.equal(child.name, ame);
assert.equal(child.name, name);
},

@@ -113,5 +114,5 @@ 'and child.category()': {

},
'should return the parent': function(err, arent){
'should return the parent': function(err, parent){
assert.isNull(err);
assert.notEqual(parent.name, ame);
assert.notEqual(parent.name, name);
}

@@ -197,5 +198,5 @@ }

this.property('name', String);
this.parent('category');
// FIXME Allow this.parent('category') by resourceful.register() earlier in resourceful.define()
});
this.Category.parent('category');
return null;

@@ -206,3 +207,3 @@ },

'Author #2': authorAndArticles('bob'),
'Category #1 & #2': category('alice', bob')
'Category #1 & #2': category('alice', 'bob')
}

@@ -209,0 +210,0 @@ }

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