File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,12 @@ module.exports = function (app) {
1212 app . remotes ( ) . before ( '**' , function ( ctx , next ) {
1313 var data , serverRelations , errors ;
1414 var regexs = [
15- / \. c r e a t e / ,
16- / p r o t o t y p e \. u p d a t e A t t r i b u t e s / ,
17- / p r o t o t y p e \. _ _ c r e a t e R e l a t i o n s h i p s _ _ / ,
18- / p r o t o t y p e \. _ _ u p d a t e R e l a t i o n s h i p s _ _ /
15+ / ^ c r e a t e $ / ,
16+ / ^ u p d a t e A t t r i b u t e s $ /
1917 ] ;
2018
2119 var matches = regexs . filter ( function ( regex ) {
22- return ctx . methodString . match ( regex ) ;
20+ return regex . test ( ctx . method . name ) ;
2321 } ) ;
2422
2523 if ( matches . length > 0 ) {
Original file line number Diff line number Diff line change @@ -3,15 +3,13 @@ var serializer = require('./serializer');
33var utils = require ( './utils' ) ;
44var _ = require ( 'lodash' ) ;
55var regexs = [
6- / \. f i n d / ,
7- / \. c r e a t e / ,
8- / \. d e l e t e B y I d / ,
9- / \. f i n d B y I d / ,
10- / p r o t o t y p e \. _ _ g e t _ _ / ,
11- / p r o t o t y p e \. u p d a t e A t t r i b u t e s / ,
12- / p r o t o t y p e \. _ _ f i n d R e l a t i o n s h i p s _ _ / ,
13- / p r o t o t y p e \. _ _ c r e a t e R e l a t i o n s h i p s _ _ / ,
14- / p r o t o t y p e \. _ _ u p d a t e R e l a t i o n s h i p s _ _ /
6+ / ^ f i n d $ / ,
7+ / ^ c r e a t e $ / ,
8+ / ^ d e l e t e B y I d $ / ,
9+ / ^ f i n d B y I d $ / ,
10+ / ^ _ _ g e t _ _ .* / ,
11+ / ^ u p d a t e A t t r i b u t e s $ / ,
12+ / ^ _ _ f i n d R e l a t i o n s h i p s _ _ .* /
1513] ;
1614
1715module . exports = function ( app , defaults ) {
@@ -27,7 +25,7 @@ module.exports = function (app, defaults) {
2725 requestedIncludes ;
2826
2927 var matches = regexs . filter ( function ( regex ) {
30- return ctx . methodString . match ( regex ) ;
28+ return regex . test ( ctx . method . name ) ;
3129 } ) ;
3230
3331 if ( ! matches . length ) {
You can’t perform that action at this time.
0 commit comments