Skip to content

Commit

Permalink
fixed; { path: [{type: "String" }] }
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Feb 3, 2013
1 parent 8635ce5 commit 6813357
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/schema/array.js
Expand Up @@ -44,7 +44,15 @@ function SchemaArray (key, cast, options) {
}
}

var caster = cast.name in Types ? Types[cast.name] : cast;
// support { type: 'String' }
var name = 'string' == typeof cast
? cast
: cast.name;

var caster = name in Types
? Types[name]
: cast;

this.casterConstructor = caster;
this.caster = new caster(null, castOptions);
if (!(this.caster instanceof EmbeddedDoc)) {
Expand Down

0 comments on commit 6813357

Please sign in to comment.