UNPKG

1.33 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.parseYarnLockV1Project = void 0;
4const _1 = require(".");
5const util_1 = require("../util");
6const build_depgraph_simple_pruned_1 = require("./build-depgraph-simple-pruned");
7const extract_yarnlock_v1_pkgs_1 = require("./extract-yarnlock-v1-pkgs");
8const 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};
27exports.parseYarnLockV1Project = parseYarnLockV1Project;
28//# sourceMappingURL=simple.js.map
\No newline at end of file