es5/index.js
function _expandNestedPaths(paths) {
  var expandedPaths = [];

  _pathsArray(paths).forEach(function (p) {
    if (p.indexOf('.') !== -1) {
      var pathsWithRoots = p.split('.').map(function (value, index, array) {
        return array.slice(0, index + 1).join('.');
      });

      expandedPaths = expandedPaths.concat(pathsWithRoots);
    } else {
      expandedPaths.push(p);
    }
  });

  return expandedPaths;
}
function _expandNestedPaths(paths) {
  var expandedPaths = [];

  _pathsArray(paths).forEach(function (p) {
    if (p.indexOf('.') !== -1) {
      var pathsWithRoots = p.split('.').map(function (value, index, array) {
        return array.slice(0, index + 1).join('.');
      });

      expandedPaths = expandedPaths.concat(pathsWithRoots);
    } else {
      expandedPaths.push(p);
    }
  });

  return expandedPaths;
}
function _expandNestedPaths ( paths ) { var expandedPaths = [ ] ; _pathsArray ( paths ) . forEach ( function ( p ) { if ( p . indexOf ( '.' ) !== - 1 ) { var pathsWithRoots = p . split ( '.' ) . map ( function ( value , index , array ) { return array . slice ( 0 , index + 1 ) . join ( '.' ) ; } ) ; expandedPaths = expandedPaths . concat ( pathsWithRoots ) ; } else { expandedPaths . push ( p ) ; } } ) ; return expandedPaths ; }
Expand nested path syntax to include root paths as well. Mainly used for
notifications on key updates, so updates on nested keys will notify root
key, and vice-versa.

Ex: 'user.email' => ['user', 'user.email']

@param {String|String[]} paths
Expand nested path syntax to include root paths as well . Mainly used for notifications on key updates so updates on nested keys will notify root key and vice - versa .