src/jsonpointer.js
function isValidJSONPointer(pointer) {
    // Validates JSON pointer string.

    if (!isString(pointer)) {
      // If it's not a string, it obviously is not valid.
      return false;
    }

    if ('' === pointer) {
      // If it is string and is an empty string, it's valid.
      return true;
    }

    // If it is non-empty string, it must match spec defined format.
    // Check Section 3 of specification for concrete syntax.
    return NON_EMPTY_POINTER_REGEXP.test(pointer);
  }
function isValidJSONPointer(pointer) {
    // Validates JSON pointer string.

    if (!isString(pointer)) {
      // If it's not a string, it obviously is not valid.
      return false;
    }

    if ('' === pointer) {
      // If it is string and is an empty string, it's valid.
      return true;
    }

    // If it is non-empty string, it must match spec defined format.
    // Check Section 3 of specification for concrete syntax.
    return NON_EMPTY_POINTER_REGEXP.test(pointer);
  }
function isValidJSONPointer ( pointer ) { // Validates JSON pointer string. if ( ! isString ( pointer ) ) { // If it's not a string, it obviously is not valid. return false ; } if ( '' === pointer ) { // If it is string and is an empty string, it's valid. return true ; } // If it is non-empty string, it must match spec defined format. // Check Section 3 of specification for concrete syntax. return NON_EMPTY_POINTER_REGEXP . test ( pointer ) ; }
Returns true if given |pointer| is valid, returns false otherwise.
@param {!string} pointer
@returns {boolean} Whether pointer is valid.
Returns true if given |pointer| is valid returns false otherwise .