File tree 2 files changed +7
-4
lines changed 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
let channelViewParamsRegex = / ^ ( [ ^ \( ] * ) \( ( .* ) \) : ( [ ^ : ] * ) $ / ;
2
+ let crudChannelRegex = / ^ c r u d > ( .* ) $ / ;
2
3
3
4
module . exports . parseChannelResourceQuery = function ( channelName ) {
4
5
if ( typeof channelName !== 'string' ) {
5
6
return null ;
6
7
}
7
- let mainParts = channelName . split ( '>' ) ;
8
- if ( mainParts [ 0 ] === 'crud' && mainParts [ 1 ] ) {
9
- let resourceString = mainParts [ 1 ] ;
8
+ let channelMatches = channelName . match ( crudChannelRegex ) ;
9
+ if ( channelMatches && channelMatches [ 1 ] ) {
10
+ let resourceString = channelMatches [ 1 ] ;
10
11
11
12
if ( resourceString . indexOf ( ':' ) !== - 1 ) {
12
13
// If resource is a view.
13
14
let viewMatches = resourceString . match ( channelViewParamsRegex ) ;
15
+ if ( ! viewMatches ) return null ;
16
+
14
17
let viewResource = {
15
18
view : viewMatches [ 1 ] ,
16
19
type : viewMatches [ 3 ]
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ag-crud-rethink" ,
3
- "version" : " 6.3.1 " ,
3
+ "version" : " 6.3.2 " ,
4
4
"description" : " A realtime REST layer plugin for SocketCluster using RethinkDB as the database" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments