ql.io-uri-template
Advanced tools
Comparing version 0.4.0 to 0.4.2
@@ -16,2 +16,3 @@ module.exports = (function(){ | ||
"digits": parse_digits, | ||
"dontencode": parse_dontencode, | ||
"expression": parse_expression, | ||
@@ -191,6 +192,7 @@ "literal": parse_literal, | ||
if(val) { | ||
var encode = !ele.dontencode; | ||
if(val.constructor == Array) { | ||
// But is the token multivalued? | ||
if(val.length === 1) { | ||
str = _append(str, val, true); | ||
str = _append(str, val, encode); | ||
} | ||
@@ -201,3 +203,3 @@ else if(ele.multivalued) { | ||
// Append as usual | ||
str = _append(str, val, true); | ||
str = _append(str, val, encode); | ||
} | ||
@@ -219,3 +221,3 @@ else { | ||
subset = val.slice(start, end); | ||
arr.push(_append(str, subset, true)); | ||
arr.push(_append(str, subset, encode)); | ||
start += ele.max; | ||
@@ -229,3 +231,3 @@ end += ele.max; | ||
else { | ||
str = _append(str, val, true); | ||
str = _append(str, val, encode); | ||
} | ||
@@ -245,3 +247,3 @@ } | ||
for(j = 0; j < val.length; j++) { | ||
arr.push(_append(str, val[j], true)); | ||
arr.push(_append(str, val[j], encode)); | ||
} | ||
@@ -253,3 +255,3 @@ str = arr; | ||
else { | ||
str = _append(str, val, true); | ||
str = _append(str, val, encode); | ||
} | ||
@@ -434,15 +436,20 @@ } | ||
var result3 = parse_required(); | ||
if (result3 !== null) { | ||
var result0 = result3; | ||
var result4 = parse_required(); | ||
if (result4 !== null) { | ||
var result0 = result4; | ||
} else { | ||
var result2 = parse_blockMerge(); | ||
if (result2 !== null) { | ||
var result0 = result2; | ||
var result3 = parse_blockMerge(); | ||
if (result3 !== null) { | ||
var result0 = result3; | ||
} else { | ||
var result1 = parse_multivalued(); | ||
if (result1 !== null) { | ||
var result0 = result1; | ||
var result2 = parse_multivalued(); | ||
if (result2 !== null) { | ||
var result0 = result2; | ||
} else { | ||
var result0 = null;; | ||
var result1 = parse_dontencode(); | ||
if (result1 !== null) { | ||
var result0 = result1; | ||
} else { | ||
var result0 = null;; | ||
}; | ||
}; | ||
@@ -545,2 +552,44 @@ }; | ||
function parse_dontencode() { | ||
var cacheKey = 'dontencode@' + pos; | ||
var cachedResult = cache[cacheKey]; | ||
if (cachedResult) { | ||
pos = cachedResult.nextPos; | ||
return cachedResult.result; | ||
} | ||
var savedPos0 = pos; | ||
if (input.substr(pos, 1) === "`") { | ||
var result1 = "`"; | ||
pos += 1; | ||
} else { | ||
var result1 = null; | ||
if (reportMatchFailures) { | ||
matchFailed("\"`\""); | ||
} | ||
} | ||
var result2 = result1 !== null | ||
? (function() { | ||
return { | ||
dontencode: true | ||
} | ||
})() | ||
: null; | ||
if (result2 !== null) { | ||
var result0 = result2; | ||
} else { | ||
var result0 = null; | ||
pos = savedPos0; | ||
} | ||
cache[cacheKey] = { | ||
nextPos: pos, | ||
result: result0 | ||
}; | ||
return result0; | ||
} | ||
function parse_multivalued() { | ||
@@ -547,0 +596,0 @@ var cacheKey = 'multivalued@' + pos; |
@@ -5,3 +5,3 @@ { | ||
"name": "ql.io-uri-template", | ||
"version": "0.4.0", | ||
"version": "0.4.2", | ||
"repository": { | ||
@@ -19,4 +19,4 @@ "type": "git", | ||
"nodeunit": "0.6.4", | ||
"underscore": "1.3.0" | ||
"underscore": "1.3.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37597
781