Added filter, fix [] as type
This commit is contained in:
parent
8c0df49e36
commit
ccffd10a58
|
@ -115,7 +115,7 @@ if (_) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
['slice', 'forEach'].forEach(function (method) {
|
['slice', 'forEach', 'filter'].forEach(function (method) {
|
||||||
var slice = [].slice;
|
var slice = [].slice;
|
||||||
List.prototype[method] = function () {
|
List.prototype[method] = function () {
|
||||||
return Array.prototype[method].apply(this.items, slice.call(arguments));
|
return Array.prototype[method].apply(this.items, slice.call(arguments));
|
||||||
|
|
|
@ -194,7 +194,7 @@ function prepareContext(models, railway, app, defSchema, done) {
|
||||||
*/
|
*/
|
||||||
ctx.property = function (name, type, params) {
|
ctx.property = function (name, type, params) {
|
||||||
if (!params) params = {};
|
if (!params) params = {};
|
||||||
if (typeof type !== 'function' && typeof type === 'object') {
|
if (typeof type !== 'function' && typeof type === 'object' && !(type instanceof Array)) {
|
||||||
params = type;
|
params = type;
|
||||||
type = String;
|
type = String;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue