1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.parseYarnLockV1Project = void 0;
|
4 | const _1 = require(".");
|
5 | const util_1 = require("../util");
|
6 | const build_depgraph_simple_pruned_1 = require("./build-depgraph-simple-pruned");
|
7 | const extract_yarnlock_v1_pkgs_1 = require("./extract-yarnlock-v1-pkgs");
|
8 | const parseYarnLockV1Project = async (pkgJsonContent, yarnLockContent, options) => {
|
9 | const { includeDevDeps, includeOptionalDeps, includePeerDeps, pruneLevel, strictOutOfSync, } = options;
|
10 | const pkgs = (0, extract_yarnlock_v1_pkgs_1.extractPkgsFromYarnLockV1)(yarnLockContent);
|
11 | const pkgJson = (0, util_1.parsePkgJson)(pkgJsonContent);
|
12 | const depGraph = pruneLevel === 'cycles'
|
13 | ? await (0, build_depgraph_simple_pruned_1.buildDepGraphYarnLockV1SimpleCyclesPruned)(pkgs, pkgJson, {
|
14 | includeDevDeps,
|
15 | strictOutOfSync,
|
16 | includeOptionalDeps,
|
17 | })
|
18 | : await (0, _1.buildDepGraphYarnLockV1Simple)(pkgs, pkgJson, {
|
19 | includeDevDeps,
|
20 | includeOptionalDeps,
|
21 | includePeerDeps,
|
22 | strictOutOfSync,
|
23 | pruneWithinTopLevelDeps: pruneLevel === 'withinTopLevelDeps',
|
24 | });
|
25 | return depGraph;
|
26 | };
|
27 | exports.parseYarnLockV1Project = parseYarnLockV1Project;
|
28 |
|
\ | No newline at end of file |