MCPcopy
hub / github.com/vercel/hyper / _generateIntegrityFile

Method _generateIntegrityFile

bin/yarn-standalone.js:48162–48323  ·  view source on GitHub ↗

* Generate integrity hash of input lockfile.

(lockfile, patterns, flags, workspaceLayout, artifacts)

Source from the content-addressed store, hash-verified

48160 */
48161
48162 _generateIntegrityFile(lockfile, patterns, flags, workspaceLayout, artifacts) {
48163 var _this3 = this;
48164
48165 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
48166 const result = (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), {
48167 artifacts
48168 });
48169
48170 result.topLevelPatterns = patterns;
48171
48172 // If using workspaces, we also need to add the workspaces patterns to the top-level, so that we'll know if a
48173 // dependency is added or removed into one of them. We must take care not to read the aggregator (if !loc).
48174 //
48175 // Also note that we can't use of workspaceLayout.workspaces[].manifest._reference.patterns, because when
48176 // doing a "yarn check", the _reference property hasn't yet been properly initialized.
48177
48178 if (workspaceLayout) {
48179 result.topLevelPatterns = result.topLevelPatterns.filter(function (p) {
48180 // $FlowFixMe
48181 return !workspaceLayout.getManifestByPattern(p);
48182 });
48183
48184 for (var _iterator4 = Object.keys(workspaceLayout.workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
48185 var _ref5;
48186
48187 if (_isArray4) {
48188 if (_i4 >= _iterator4.length) break;
48189 _ref5 = _iterator4[_i4++];
48190 } else {
48191 _i4 = _iterator4.next();
48192 if (_i4.done) break;
48193 _ref5 = _i4.value;
48194 }
48195
48196 const name = _ref5;
48197
48198 if (!workspaceLayout.workspaces[name].loc) {
48199 continue;
48200 }
48201
48202 const manifest = workspaceLayout.workspaces[name].manifest;
48203
48204 if (manifest) {
48205 for (var _iterator5 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
48206 var _ref6;
48207
48208 if (_isArray5) {
48209 if (_i5 >= _iterator5.length) break;
48210 _ref6 = _iterator5[_i5++];
48211 } else {
48212 _i5 = _iterator5.next();
48213 if (_i5.done) break;
48214 _ref6 = _i5.value;
48215 }
48216
48217 const dependencyType = _ref6;
48218
48219 const dependencies = manifest[dependencyType];

Callers 2

checkMethod · 0.80
saveMethod · 0.80

Calls 13

_load_asyncToGeneratorFunction · 0.85
_load_extendsFunction · 0.85
INTEGRITY_FILE_DEFAULTSFunction · 0.85
_load_constantsFunction · 0.85
_load_miscFunction · 0.85
_load_fsFunction · 0.85
filterMethod · 0.80
getManifestByPatternMethod · 0.80
_getModulesFoldersMethod · 0.80
_getModulesRootFolderMethod · 0.80
_getIntegrityListingMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected