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

Method _compareIntegrityFiles

bin/yarn-standalone.js:48337–48427  ·  view source on GitHub ↗
(actual, expected, checkFiles, workspaceLayout)

Source from the content-addressed store, hash-verified

48335 }
48336
48337 _compareIntegrityFiles(actual, expected, checkFiles, workspaceLayout) {
48338 if (!expected) {
48339 return 'EXPECTED_IS_NOT_A_JSON';
48340 }
48341
48342 if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.linkedModules, expected.linkedModules)) {
48343 return 'LINKED_MODULES_DONT_MATCH';
48344 }
48345
48346 if (actual.systemParams !== expected.systemParams) {
48347 return 'SYSTEM_PARAMS_DONT_MATCH';
48348 }
48349
48350 let relevantExpectedFlags = expected.flags.slice();
48351
48352 // If we run "yarn" after "yarn --check-files", we shouldn't fail the less strict validation
48353 if (actual.flags.indexOf('checkFiles') === -1) {
48354 relevantExpectedFlags = relevantExpectedFlags.filter(flag => flag !== 'checkFiles');
48355 }
48356
48357 if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.flags, relevantExpectedFlags)) {
48358 return 'FLAGS_DONT_MATCH';
48359 }
48360
48361 if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.topLevelPatterns, expected.topLevelPatterns || [])) {
48362 return 'PATTERNS_DONT_MATCH';
48363 }
48364
48365 for (var _iterator9 = Object.keys(actual.lockfileEntries), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
48366 var _ref10;
48367
48368 if (_isArray9) {
48369 if (_i9 >= _iterator9.length) break;
48370 _ref10 = _iterator9[_i9++];
48371 } else {
48372 _i9 = _iterator9.next();
48373 if (_i9.done) break;
48374 _ref10 = _i9.value;
48375 }
48376
48377 const key = _ref10;
48378
48379 if (actual.lockfileEntries[key] !== expected.lockfileEntries[key]) {
48380 return 'LOCKFILE_DONT_MATCH';
48381 }
48382 }
48383
48384 for (var _iterator10 = Object.keys(expected.lockfileEntries), _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
48385 var _ref11;
48386
48387 if (_isArray10) {
48388 if (_i10 >= _iterator10.length) break;
48389 _ref11 = _iterator10[_i10++];
48390 } else {
48391 _i10 = _iterator10.next();
48392 if (_i10.done) break;
48393 _ref11 = _i10.value;
48394 }

Callers 1

checkMethod · 0.80

Calls 4

_load_miscFunction · 0.85
indexOfMethod · 0.80
filterMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected