Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
star(){
let _that = this;
hashElement(_that.options.entry, {
folders: { exclude: ['.*', 'node_modules', 'test_coverage'] },
files: { include: ['*.md']},
matchBasename: true
}).then(hash => {
nodeFilelist.read([_that.options.entry],{"ext":'md'}, res => {
res.map((item,index) =>{
if(index == 30){
debugger
}
let fileSplits = item.path.split(path.sep);
let fileName = fileSplits.pop();
if(_that.isDoc(fileName)){
fileName = fileSplits.pop();
}else{
fileName = fileName.replace(/\.md/,'');
private async getHashOfOwnFiles(): Promise {
return hashElement(this.packageRoot, {
encoding: "hex",
...this.options.watchGlobs
}).then(result => {
logger.silly("getHashOfOwnFiles:", result);
return result.hash;
});
}
async function calculateProjectHash(rootDir) {
const { hash } = await hashElement(rootDir, {
folders: {
exclude: ['build', 'node_modules'],
},
files: {
include: ['*.ts', 'expotools.js', 'yarn.lock', 'tsconfig.js'],
},
});
return hash;
}
function getHashForResourceDir(dirPath) {
const options = {
folders: { exclude: ['.*', 'node_modules', 'test_coverage'] },
};
return hashElement(dirPath, options).then(result => result.hash);
}
function getHashForResourceDir(dirPath) {
const options = {
folders: { exclude: ['.*', 'node_modules', 'test_coverage'] },
};
return hashElement(dirPath, options)
.then(result => result.hash);
}
async function hashDirectory(directory) {
const options = {
encoding: 'hex',
folders: {
exclude: ['build'],
},
};
return hashElement(directory, options).then(result => result.hash);
}
const getChecksumForCurrentRevision = async cwd => {
const packagesDir = join(cwd, 'packages');
const hashedPackages = await hashElement(packagesDir, {
encoding: 'hex',
files: {exclude: ['.DS_Store']},
});
return hashedPackages.hash.slice(0, 7);
};
(async () => {
const specNodeModulesPath = path.resolve(__dirname, '../spec/node_modules')
if (!fs.existsSync(specNodeModulesPath)) {
return null
}
const { hash } = await hashElement(specNodeModulesPath, {
folders: {
exclude: ['.bin']
}
})
return hash
})()
])
function getHashForResourceDir(dirPath) {
const options = {
folders: { exclude: ['.*', 'node_modules', 'test_coverage', 'dist', 'build'] },
};
return hashElement(dirPath, options).then(result => result.hash);
}