Skip to content

Commit 6578e61

Browse files
committed
[fix] Invalid regular expression
1 parent 2e34341 commit 6578e61

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lib/swagger.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,24 @@ Object.keys = Object.keys || (function () {
5757
'constructor'
5858
],
5959
DontEnumsLength = DontEnums.length;
60-
60+
6161
return function (o) {
6262
if (typeof o != "object" && typeof o != "function" || o === null)
6363
throw new TypeError("Object.keys called on a non-object");
64-
64+
6565
var result = [];
6666
for (var name in o) {
6767
if (hasOwnProperty.call(o, name))
6868
result.push(name);
6969
}
70-
70+
7171
if (hasDontEnumBug) {
7272
for (var i = 0; i < DontEnumsLength; i++) {
7373
if (hasOwnProperty.call(o, DontEnums[i]))
7474
result.push(DontEnums[i]);
75-
}
75+
}
7676
}
77-
77+
7878
return result;
7979
};
8080
})();
@@ -478,8 +478,7 @@ SwaggerResource.prototype.addOperations = function(resource_path, ops, consumes,
478478

479479
SwaggerResource.prototype.sanitize = function(nickname) {
480480
var op;
481-
op = nickname.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|./?,\\'""-]/g, '_');
482-
//'
481+
op = nickname.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g, '_');
483482
op = op.replace(/((_){2,})/g, '_');
484483
op = op.replace(/^(_)*/g, '');
485484
op = op.replace(/([_])*$/g, '');
@@ -812,7 +811,7 @@ SwaggerOperation.prototype.getSampleJSON = function(type, models) {
812811
else
813812
return JSON.stringify(val, null, 2);
814813
}
815-
else
814+
else
816815
return val;
817816
}
818817
};

0 commit comments

Comments
 (0)