Transform a component path into a string - useful for error checking
If path is invalid null is returned
@param {Object} ref the ref structure returned by the PEG parser for components and endcomponents
@retrun {String} the path as a string
510568
function(ref) {
        if (ref.category !== "objectref" || !ref.path || !ref.path.length || !ref.path.join) {
            return null;
        }
        return ref.path.join(".");
    }
747298
protected String transformMardownLinks(String content, ReferenceContext references) {
		if (!isMarkdownToHtmlReferenceTransformation()) {
			return content;
		}

		// Prepare replacement data structures
		final Map<BasedSequence, String> replacements = new TreeMap<>((cmp1, cmp2) -> {
			final int cmp = Integer.compare(cmp2.getStartOffset(), cmp1.getStartOffset());
			if (cmp != 0) {
				return cmp;
			}
			return Integer.compare(cmp2.getEndOffset(), cmp1.getEndOffset());
		});

		// Visit the links and record the transformations
		final MutableDataSet options = new MutableDataSet();
		final Parser parser = Parser.builder(options).build();
		final Node document = parser.parse(content);
		final NodeVisitor visitor = new NodeVisitor(
				new VisitHandler<>(Link.class, it -> {
					URL url = FileSystem.convertStringToURL(it.getUrl().toString(), true);
					url = transformURL(url, references);
					if (url != null) {
						replacements.put(it.getUrl(), convertURLToString(url));
					}
				}));
		visitor.visitChildren(document);

		// Apply the replacements
		if (!replacements.isEmpty()) {
			final StringBuilder buffer = new StringBuilder(content);
			for (final Entry<BasedSequence, String> entry : replacements.entrySet()) {
				final BasedSequence seq = entry.getKey();
				buffer.replace(seq.getStartOffset(), seq.getEndOffset(), entry.getValue());
			}
			return buffer.toString();
		}
		return content;
	}
489660
function processComponent(component) {
    let name = component.name;
    if (component.variant) {
        name += ` (${component.variant})`;
    }
    const pathName = component.path.slice(0);
    pathName.push(name);

    // If the component is invalid
    if (!component.valid) {
        console.log(`${chalk.bold.red('X')} ${pathName.join('/')}`);
        return;
    }

    console.log(`${chalk.green('√')} ${pathName.join('/')}`);
    registerComponent(component);
}
1184739
function normalizePath (path, basePath) {
  var joined = nodepath.join(basePath || '/', path || '');
  var normalized = nodepath.normalize(joined);

  return (normalized !== '/' ? normalized : null);
}
666194
public JsonNode getRefSchemaNode(String ref) {
        JsonSchema schema = findAncestor();
        JsonNode node = schema.getSchemaNode();

        if (ref.startsWith("#/")) {
            // handle local ref
            String[] keys = ref.substring(2).split("/");
            for (String key : keys) {
                try {
                    key = URLDecoder.decode(key, "utf-8");
                } catch (UnsupportedEncodingException e) {
                }
                Matcher matcher = intPattern.matcher(key);
                if (matcher.matches()) {
                    node = node.get(Integer.parseInt(key));
                } else {
                    node = node.get(key);
                }
                if (node == null){
                    JsonSchema subSchema = schema.fetchSubSchemaNode(validationContext);
                    if (subSchema != null) {
                        node = subSchema.getRefSchemaNode(ref);
                    }
                }
                if (node == null){
                    break;
                }
            }
        }
        return node;
    }
244717
function simpleRef(ref) {
  if (!ref) {
    return null;
  }
  var index = ref.lastIndexOf('/');
  if (index >= 0) {
    ref = ref.substr(index + 1);
  }
  return toClassName(ref);
}
245565
public static String pathStringFromComponents(String[] components) {
        if (null == components || components.length == 0) {
            return null;
        }
        return cleanPath(join(components, SEPARATOR));
    }
805451
def make_path(*path_components):
    
    path_components = [quote(component) for component in path_components if component]
    path = '/'.join(path_components)
    if not path.startswith('/'):
        path = '/' + path
    return path
604837
def build_reference(component_type, openapi_major_version, component_name):
    
    return {
        "$ref": "#/{}{}/{}".format(
            "components/" if openapi_major_version >= 3 else "",
            COMPONENT_SUBSECTIONS[openapi_major_version][component_type],
            component_name,
        )
    }
97128
function cellref (ref) {
  if (R1C1.test(ref)) {
    return convertR1C1toA1(ref)
  }

  if (A1.test(ref)) {
    return convertA1toR1C1(ref)
  }

  throw new Error(`could not detect cell reference notation for ${ref}`)
}
148356
function(s, refmap) {
  this.subject = s;
  this.pos = 0;
  var rawlabel;
  var dest;
  var title;
  var matchChars;
  var startpos = this.pos;
  var match;

  // label:
  matchChars = this.parseLinkLabel();
  if (matchChars === 0) {
    return 0;
  } else {
    rawlabel = this.subject.substr(0, matchChars);
  }

  // colon:
  if (this.peek() === ':') {
    this.pos++;
  } else {
    this.pos = startpos;
    return 0;
  }

  //  link url
  this.spnl();

  dest = this.parseLinkDestination();
  if (dest === null || dest.length === 0) {
    this.pos = startpos;
    return 0;
  }

  var beforetitle = this.pos;
  this.spnl();
  title = this.parseLinkTitle();
  if (title === null) {
    title = '';
    // rewind before spaces
    this.pos = beforetitle;
  }

  // make sure we're at line end:
  if (this.match(/^ *(?:\n|$)/) === null) {
    this.pos = startpos;
    return 0;
  }

  var normlabel = normalizeReference(rawlabel);

  if (!refmap[normlabel]) {
    refmap[normlabel] = { destination: dest, title: title };
  }
  return this.pos - startpos;
}
298017
function defaultWarningMessage(_ref) {
  var componentName = _ref.componentName,
      prop = _ref.prop,
      renamedProps = _ref.renamedProps;

  return componentName + ' Warning: Prop "' + prop + '" is deprecated, use "' + renamedProps[prop] + '" instead.';
}
756228
function pathStrToPathArr(path) {
	path = path.substr(1).split('/').map(part => {
		// De-tokenize '/' characters in path name
		return part.replace(/~1/g, '/');
	});

	// For some reason, path arrays whose only item is an empty string cause errors.
	// In this case, we replace the path with an empty array, which seems to be fine.
	if (path.length === 1 && path[0] === '') {
		path = [];
	}

	return path;
}
857242
function getPath( object , path ) {
	var i = 0 , iMax = path.length , p = object ;

	//console.log( "getPath():" , object , path ) ;

	try {
		for ( ; i < iMax ; i ++ ) {
			//console.log( "Next path:" , path[ i ] ) ;
			p = p[ path[ i ] ] ;
		}
	}
	catch ( error ) {
		throw new Error( "Bad ref: path not found" ) ;
	}

	return p ;
}
1243554
function convertA1toR1C1 (ref) {
  if (!A1.test(ref)) {
    throw new Error(`${ref} is not a valid A1 cell reference`)
  }

  var refParts = ref
    .replace(A1, '$1,$2')
    .split(',')

  var columnStr = refParts[0]
  var row = refParts[1]
  var column = 0

  for (var i = 0; i < columnStr.length; i++) {
    column = 26 * column + columnStr.charCodeAt(i) - 64
  }

  return `R${row}C${column}`
}
1095853
function (value) {
        var result = this.get(value.$ref);
        if (isObj(result) && isStr(value.$tmpl)) {
            result = strTemplate(value.$tmpl, result);
        }
        return result;
    }
198111
function Pointer ($ref, path, friendlyPath) {
  /**
   * The {@link $Ref} object that contains this {@link Pointer} object.
   * @type {$Ref}
   */
  this.$ref = $ref;

  /**
   * The file path or URL, containing the JSON pointer in the hash.
   * This path is relative to the path of the main JSON schema file.
   * @type {string}
   */
  this.path = path;

  /**
   * The original path or URL, used for error messages.
   * @type {string}
   */
  this.originalPath = friendlyPath || path;

  /**
   * The value of the JSON pointer.
   * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).
   * @type {?*}
   */
  this.value = undefined;

  /**
   * Indicates whether the pointer references itself.
   * @type {boolean}
   */
  this.circular = false;

  /**
   * The number of indirect references that were traversed to resolve the value.
   * Resolving a single pointer may require resolving multiple $Refs.
   * @type {number}
   */
  this.indirections = 0;
}