Skip to content

Commit 5d1d1d3

Browse files
committed
v6.3.2
1 parent 2007134 commit 5d1d1d3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

channel-resource-parser.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
let channelViewParamsRegex = /^([^\(]*)\((.*)\):([^:]*)$/;
2+
let crudChannelRegex = /^crud>(.*)$/;
23

34
module.exports.parseChannelResourceQuery = function (channelName) {
45
if (typeof channelName !== 'string') {
56
return null;
67
}
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];
1011

1112
if (resourceString.indexOf(':') !== -1) {
1213
// If resource is a view.
1314
let viewMatches = resourceString.match(channelViewParamsRegex);
15+
if (!viewMatches) return null;
16+
1417
let viewResource = {
1518
view: viewMatches[1],
1619
type: viewMatches[3]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ag-crud-rethink",
3-
"version": "6.3.1",
3+
"version": "6.3.2",
44
"description": "A realtime REST layer plugin for SocketCluster using RethinkDB as the database",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)