modm
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -64,2 +64,10 @@ var prepare = require('./options').prepare; | ||
function getType (value) { | ||
if (typeof value === 'string') { | ||
return value.toLowerCase(); | ||
} | ||
return (value.name || value.constructor.name).toLowerCase(); | ||
} | ||
// prepare schema path options | ||
@@ -73,3 +81,3 @@ function path (path, options) { | ||
type = (options.name || options.constructor.name).toLowerCase(); | ||
type = getType(options); | ||
options = {type: type} | ||
@@ -79,3 +87,3 @@ | ||
type = (options.type.name || options.type.constructor.name).toLowerCase(); | ||
type = getType(options.type); | ||
options.type = type; | ||
@@ -82,0 +90,0 @@ } |
{ | ||
"name": "modm", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"author": "Adrian Ottiker <adrian@ottiker.com>", | ||
@@ -5,0 +5,0 @@ "description": "A MongoDB Object Document Mapper (ODM)", |
32339
795