UNPKG

1.25 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.getChildNodeYarnLockV1Workspace = void 0;
4const errors_1 = require("../../errors");
5const parsers_1 = require("../../parsers");
6const util_1 = require("../util");
7const getChildNodeYarnLockV1Workspace = (name, depInfo, workspacePkgNameToVersion, pkgs, strictOutOfSync, includeOptionalDeps) => {
8 let childNode;
9 if (workspacePkgNameToVersion[name]) {
10 const version = workspacePkgNameToVersion[name];
11 // This is just to mimic old behavior where when StrictOutOfSync is turned on,
12 // any cross referencing between workspace packages will lead to a throw
13 if (strictOutOfSync) {
14 throw new errors_1.OutOfSyncError(`${name}@${version}`, parsers_1.LockfileType.yarn);
15 }
16 childNode = {
17 id: `${name}@${version}`,
18 name: name,
19 version: version,
20 dependencies: {},
21 isDev: depInfo.isDev,
22 };
23 }
24 else {
25 childNode = (0, util_1.getChildNode)(name, depInfo, pkgs, strictOutOfSync, includeOptionalDeps);
26 }
27 return childNode;
28};
29exports.getChildNodeYarnLockV1Workspace = getChildNodeYarnLockV1Workspace;
30//# sourceMappingURL=util.js.map
\No newline at end of file