tools/isobuild/import-scanner.js
// deduplicated according to their .parentPath properties.
deduplicated according to their .parentPath properties.
deduplicated according to their . parentPath properties .
static mergeMissing(target, source) {
    keys(source).forEach(id => {
      const importInfoList = source[id];
      const pathToIndex = Object.create(null);
      if (! has(target, id)) {
        target[id] = [];
      } else {
        target[id].forEach((importInfo, index) => {
          pathToIndex[importInfo.parentPath] = index;
        });
      }
      importInfoList.forEach(importInfo => {
        const { parentPath } = importInfo;
        if (typeof parentPath === "string") {
          const index = pathToIndex[parentPath];
          if (typeof index === "number") {
            target[id][index] = importInfo;
            return;
          }
        }
        target[id].push(importInfo);
      });
    });
  }
static mergeMissing ( target , source ) { keys ( source ) . forEach ( id => { const importInfoList = source [ id ] ; const pathToIndex = Object . create ( null ) ; if ( ! has ( target , id ) ) { target [ id ] = [ ] ; } else { target [ id ] . forEach ( ( importInfo , index ) => { pathToIndex [ importInfo . parentPath ] = index ; } ) ; } importInfoList . forEach ( importInfo => { const { parentPath } = importInfo ; if ( typeof parentPath === "string" ) { const index = pathToIndex [ parentPath ] ; if ( typeof index === "number" ) { target [ id ] [ index ] = importInfo ; return ; } } target [ id ] . push ( importInfo ) ; } ) ; } ) ; }
deduplicated according to their .parentPath properties.
deduplicated according to their . parentPath properties .
// If an importInfo object with this .parentPath is already // present in the target[id] array, replace it.