function getArrayFromComponentPath(pathStr) {
  if (!pathStr || !_.isString(pathStr)) {
    if (!_.isArray(pathStr)) {
      return [pathStr];
    }
    return pathStr;
  }
  return pathStr.replace(/[[\]]/g, '.')
    .replace(/\.\./g, '.')
    .replace(/(^\.)|(\.$)/g, '')
    .split('.')
    .map(part => _.defaultTo(_.toNumber(part), part));
}
Takes a component path, and returns a component path array.
@param {string} pathStr - The path string to convert to an array.
@returns {Array<string>} - The array of paths.