代码拉取完成,页面将自动刷新
const _ = require('lodash');
const { asyncify } = require('asyncbox');
const { fs, logger } = require('appium-support');
const path = require('path');
const log = new logger.getLogger('ShrinkwrapValidator');
async function main () {
const shrinkwrapPath = path.resolve('npm-shrinkwrap.json');
if (!(await fs.exists(shrinkwrapPath))) {
log.info('No shrinkwrap found. Skipping shrinkwrap check');
return;
}
const shrinkwrap = JSON.parse(await fs.readFile(shrinkwrapPath));
const backupShrinkwrap = JSON.parse(await fs.readFile(path.resolve('npm-shrinkwrap-backup.json')));
log.info('Checking that pruned shrinkwrap is a subset of primary shrinkwrap');
if (!_.isMatch(backupShrinkwrap, shrinkwrap)) {
log.errorAndThrow('Pruned shrinkwrap (shrinkwrap with dev dependencies removed) is not a subset of the original npm-shrinkwrap.json');
}
log.info('Shrinkwrap check passed');
}
if (require.main === module) {
asyncify(main);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。