Skip to content

Commit b56c949

Browse files
committed
fixed; { path: [{type: "String" }] }
1 parent dce0fdd commit b56c949

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/schema/array.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ function SchemaArray (key, cast, options) {
4444
}
4545
}
4646

47-
var caster = cast.name in Types ? Types[cast.name] : cast;
47+
// support { type: 'String' }
48+
var name = 'string' == typeof cast
49+
? cast
50+
: cast.name;
51+
52+
var caster = name in Types
53+
? Types[name]
54+
: cast;
55+
4856
this.casterConstructor = caster;
4957
this.caster = new caster(null, castOptions);
5058
if (!(this.caster instanceof EmbeddedDoc)) {

0 commit comments

Comments
 (0)