Skip to content

Commit

Permalink
refactor: Refactor and reorder constant and variable definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Seidelsohn committed May 12, 2023
1 parent 0b500dd commit 4063551
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ http://yuilibrary.com/license/

const LICENSE_TITLE_UNKNOWN = 'UNKNOWN';
const LICENSE_TITLE_UNLICENSED = 'UNLICENSED';
const INITIAL_MODULE_INFO = {
licenses: LICENSE_TITLE_UNKNOWN,
};

const chalk = require('chalk');
const debug = require('debug');
Expand All @@ -32,15 +35,16 @@ debugLog.log = console.log.bind(console);
// This function calls itself recursively. On the first iteration, it collects the data of the main program, during the
// second iteration, it collects the data from all direct dependencies, then it collects their dependencies and so on.
const recursivelyCollectAllDependencies = (options) => {
const moduleInfo = { licenses: LICENSE_TITLE_UNKNOWN };
const { color: colorize, deps: currentExtendedPackageJson, unknown } = options;
const moduleInfo = { ...INITIAL_MODULE_INFO };
const currentPackageNameAndVersion = `${currentExtendedPackageJson.name}@${currentExtendedPackageJson.version}`;

let { data } = options;
let licenseFilesInCurrentModuleDirectory = [];
let licenseData;
let licenseFile;
let noticeFiles = [];
let readmeFile;
let { data } = options;
let clarification = options.clarifications?.[currentPackageNameAndVersion];
let passedClarificationCheck = clarification?.checksum ? false : true;

Expand Down

0 comments on commit 4063551

Please sign in to comment.