bin/uritemplate.js
function isPctEncoded (chr) {
        if (!isPercentDigitDigit(chr, 0)) {
            return false;
        }
        var firstCharCode = parseHex2(chr, 1);
        var numBytes = utf8.numBytes(firstCharCode);
        if (numBytes === 0) {
            return false;
        }
        for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
            if (!isPercentDigitDigit(chr, 3*byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(chr, 3*byteNumber + 1))) {
                return false;
            }
        }
        return true;
    }
function isPctEncoded (chr) {
        if (!isPercentDigitDigit(chr, 0)) {
            return false;
        }
        var firstCharCode = parseHex2(chr, 1);
        var numBytes = utf8.numBytes(firstCharCode);
        if (numBytes === 0) {
            return false;
        }
        for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
            if (!isPercentDigitDigit(chr, 3*byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(chr, 3*byteNumber + 1))) {
                return false;
            }
        }
        return true;
    }
function isPctEncoded ( chr ) { if ( ! isPercentDigitDigit ( chr , 0 ) ) { return false ; } var firstCharCode = parseHex2 ( chr , 1 ) ; var numBytes = utf8 . numBytes ( firstCharCode ) ; if ( numBytes === 0 ) { return false ; } for ( var byteNumber = 1 ; byteNumber < numBytes ; byteNumber += 1 ) { if ( ! isPercentDigitDigit ( chr , 3 * byteNumber ) || ! utf8 . isValidFollowingCharCode ( parseHex2 ( chr , 3 * byteNumber + 1 ) ) ) { return false ; } } return true ; }
Returns whether or not the given char sequence is a correctly pct-encoded sequence.
@param chr
@return {boolean}
Returns whether or not the given char sequence is a correctly pct - encoded sequence .