docs/src/modules/utils/find.js
function findComponents(directory, components = []) {
  const items = fs.readdirSync(directory);

  items.forEach(item => {
    const itemPath = path.resolve(directory, item);

    if (fs.statSync(itemPath).isDirectory()) {
      findComponents(itemPath, components);
      return;
    }

    if (!componentRegex.test(item)) {
      return;
    }

    components.push({
      filename: itemPath,
    });
  });

  return components;
}
function findComponents(directory, components = []) {
  const items = fs.readdirSync(directory);

  items.forEach(item => {
    const itemPath = path.resolve(directory, item);

    if (fs.statSync(itemPath).isDirectory()) {
      findComponents(itemPath, components);
      return;
    }

    if (!componentRegex.test(item)) {
      return;
    }

    components.push({
      filename: itemPath,
    });
  });

  return components;
}
function findComponents ( directory , components = [ ] ) { const items = fs . readdirSync ( directory ) ; items . forEach ( item => { const itemPath = path . resolve ( directory , item ) ; if ( fs . statSync ( itemPath ) . isDirectory ( ) ) { findComponents ( itemPath , components ) ; return ; } if ( ! componentRegex . test ( item ) ) { return ; } components . push ( { filename : itemPath , } ) ; } ) ; return components ; }
Returns the component source in a flat array.
Returns the component source in a flat array .