{"size": 1298, "ext": "js", "max_stars_repo_path": "bin/swift-link.js", "max_stars_repo_name": "rhdeck/react-native-advanced-core", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "bin/swift-link.js", "max_issues_repo_name": "rhdeck/react-native-advanced-core", "max_issues_repo_issues_event_min_datetime": "2020-06-19T22:34:34.000Z", "max_issues_repo_issues_event_max_datetime": "2020-06-19T22:34:34.000Z", "max_forks_repo_path": "bin/swift-link.js", "max_forks_repo_name": "rhdeck/react-native-advanced-core", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 33.2820512821, "max_line_length": 77, "alphanum_fraction": 0.6648690293}
#!/usr/bin/env node
console.error("This shoudl never by called");
process.exit(1);
var { existsSync } = require("fs");
var { join } = require("path");
//Get my directory
const { dependencies, devDependencies } = require(join(
  process.cwd(),
  "package.json"
));
//scan for swift icons
const allDependencies = Object.keys({ ...dependencies, ...devDependencies });
allDependencies.forEach((dependency) => {
  const base = require.resolve.paths(dependency).find((path) => {
    const joined = join(path, dependency, "react-native.config.js");
    return existsSync(joined);
  });
  if (!base) return;
  const rnsc = join(base, dependency, "react-native.config.js");
  if (!rnsc) return;
  const { prelink } = require(rnsc);
  if (prelink)
    if (Array.isArray(prelink)) prelink.forEach((p) => p());
    else prelink();
});
allDependencies.forEach((dependency) => {
  const base = require.resolve.paths(dependency).find((path) => {
    const joined = join(path, dependency, "react-native-swift.config.js");
    return existsSync(joined);
  });
  if (!base) return;
  const rnsc = join(base, dependency, "react-native-swift.config.js");
  if (!rnsc) return;
  const { postlink } = require(rnsc);
  if (postlink)
    if (Array.isArray(postlink)) postlink.forEach((p) => p());
    else postlink();
});
