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

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

  // If it is non-empty string, it must match spec defined format.
  // Check Section 3 of specification for concrete syntax.
  return validPointerRegex.test(pointer);
}
function isValidJSONPointer(pointer) {
  if (!_.isString(pointer)) {
      // If it's not a string, it obviously is not valid.
      return false;
  }

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

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

@param pointer
@returns {boolean}
Validates JSON pointer string .