不要怂,就是干,撸起袖子干!

Commit ed60554a by Dr. Evil

Fix JSHint issue with constructor name starting not with an uppercase letter

1 parent 440a168d
......@@ -387,14 +387,14 @@ BLOB.prototype.toSql = function() {
* @property RANGE
*/
var RANGE = function (subtype) {
var RANGE = function (Subtype) {
var options = {};
if(typeof subtype === 'function') { // if subtype passed - instantiate object of this subtype and return new function
options.subtype = new subtype();
if(typeof Subtype === 'function') { // if subtype passed - instantiate object of this subtype and return new function
options.subtype = new Subtype();
return RANGE.bind({}, options);
}
else if(typeof subtype === 'object' && subtype.hasOwnProperty('subtype'))
options = subtype;
else if(typeof Subtype === 'object' && Subtype.hasOwnProperty('subtype'))
options = Subtype;
if (!(this instanceof RANGE)) return new RANGE(options);
ABSTRACT.apply(this, arguments);
......
......@@ -33,11 +33,11 @@ module.exports = {
return (data.inclusive[0] ? '[' : '(') + JSON.stringify(data[0]) + ',' + JSON.stringify(data[1]) +
(data.inclusive[1] ? ']' : ')');
},
parse: function (value, attrType) {
parse: function (value, AttributeType) {
if (value === null) return null;
if(typeof attrType === 'function') attrType = new attrType();
attrType = attrType || '';
if(typeof AttributeType === 'function') AttributeType = new AttributeType();
AttributeType = AttributeType || '';
var result = value
.slice(1, -1)
......@@ -48,7 +48,7 @@ module.exports = {
result = result
.map(function (value) {
switch (attrType.toString()) {
switch (AttributeType.toString()) {
case 'int4range':
return parseInt(value, 10);
case 'numrange':
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!