From ccffd10a58ac0c865fa2dafb147d6a0fb6d520e5 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Mon, 18 Mar 2013 23:45:34 +0400 Subject: [PATCH] Added filter, fix [] as type --- lib/list.js | 2 +- lib/railway.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/list.js b/lib/list.js index f985185a..77b825dd 100644 --- a/lib/list.js +++ b/lib/list.js @@ -115,7 +115,7 @@ if (_) { }); } -['slice', 'forEach'].forEach(function (method) { +['slice', 'forEach', 'filter'].forEach(function (method) { var slice = [].slice; List.prototype[method] = function () { return Array.prototype[method].apply(this.items, slice.call(arguments)); diff --git a/lib/railway.js b/lib/railway.js index 9c260b5d..14503229 100644 --- a/lib/railway.js +++ b/lib/railway.js @@ -194,7 +194,7 @@ function prepareContext(models, railway, app, defSchema, done) { */ ctx.property = function (name, type, params) { if (!params) params = {}; - if (typeof type !== 'function' && typeof type === 'object') { + if (typeof type !== 'function' && typeof type === 'object' && !(type instanceof Array)) { params = type; type = String; }