perimeterx-js-core 0.21.5 → 0.21.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -136,7 +136,7 @@ var DefaultGraphQLParser = /** @class */ (function () {
|
|
|
136
136
|
};
|
|
137
137
|
DefaultGraphQLParser.prototype.getOperationNameToTypeMap = function (query) {
|
|
138
138
|
var operationTypesString = Object.values(model_1.GraphQLOperationType).join('|');
|
|
139
|
-
var pattern = new RegExp("\\
|
|
139
|
+
var pattern = new RegExp("\\b(".concat(operationTypesString, ")\\s+(\\w+)?\\s*(\\{|\\()[^\\}\\)]*[\\}|\\)]"), 'gm');
|
|
140
140
|
var match;
|
|
141
141
|
var map = {};
|
|
142
142
|
while ((match = pattern.exec(query)) !== null) {
|
|
@@ -146,7 +146,7 @@ var DefaultGraphQLParser = /** @class */ (function () {
|
|
|
146
146
|
// query contains two operations with the same name which is illegal
|
|
147
147
|
return null;
|
|
148
148
|
}
|
|
149
|
-
else {
|
|
149
|
+
else if (operationName) {
|
|
150
150
|
map[operationName] = operationType;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -14,4 +14,4 @@ exports.PUSH_DATA_FEATURE_HEADER_NAME = 'x-px-feature';
|
|
|
14
14
|
exports.EMAIL_ADDRESS_REGEX = /^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$/;
|
|
15
15
|
exports.URL_REGEX = /^(https?\:)\/\/(([^@\s:]+):?([^@\s]*)@)?(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/;
|
|
16
16
|
exports.REGEX_STRUCTURE = /^\/(.+?)\/([gimsuyvd]*)$/;
|
|
17
|
-
exports.CORE_MODULE_VERSION = 'JS Core 0.21.
|
|
17
|
+
exports.CORE_MODULE_VERSION = 'JS Core 0.21.6';
|
|
@@ -67,7 +67,7 @@ export class DefaultGraphQLParser {
|
|
|
67
67
|
}
|
|
68
68
|
getOperationNameToTypeMap(query) {
|
|
69
69
|
const operationTypesString = Object.values(GraphQLOperationType).join('|');
|
|
70
|
-
const pattern = new RegExp(`\\
|
|
70
|
+
const pattern = new RegExp(`\\b(${operationTypesString})\\s+(\\w+)?\\s*(\\{|\\()[^\\}\\)]*[\\}|\\)]`, 'gm');
|
|
71
71
|
let match;
|
|
72
72
|
const map = {};
|
|
73
73
|
while ((match = pattern.exec(query)) !== null) {
|
|
@@ -77,7 +77,7 @@ export class DefaultGraphQLParser {
|
|
|
77
77
|
// query contains two operations with the same name which is illegal
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
|
-
else {
|
|
80
|
+
else if (operationName) {
|
|
81
81
|
map[operationName] = operationType;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -11,4 +11,4 @@ export const PUSH_DATA_FEATURE_HEADER_NAME = 'x-px-feature';
|
|
|
11
11
|
export const EMAIL_ADDRESS_REGEX = /^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$/;
|
|
12
12
|
export const URL_REGEX = /^(https?\:)\/\/(([^@\s:]+):?([^@\s]*)@)?(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/;
|
|
13
13
|
export const REGEX_STRUCTURE = /^\/(.+?)\/([gimsuyvd]*)$/;
|
|
14
|
-
export const CORE_MODULE_VERSION = 'JS Core 0.21.
|
|
14
|
+
export const CORE_MODULE_VERSION = 'JS Core 0.21.6';
|
|
@@ -11,4 +11,4 @@ export declare const PUSH_DATA_FEATURE_HEADER_NAME = "x-px-feature";
|
|
|
11
11
|
export declare const EMAIL_ADDRESS_REGEX: RegExp;
|
|
12
12
|
export declare const URL_REGEX: RegExp;
|
|
13
13
|
export declare const REGEX_STRUCTURE: RegExp;
|
|
14
|
-
export declare const CORE_MODULE_VERSION = "JS Core 0.21.
|
|
14
|
+
export declare const CORE_MODULE_VERSION = "JS Core 0.21.6";
|