Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
browserifyOpts = browserifyOpts || { };
opts = opts || { };
var hash = require( 'hash-string' );
var xtend = require( 'xtend' );
var id = 'persistify_' + hash( process.cwd() + trim( opts.cacheId ) );
var depsCacheId = 'deps-cx-' + id;
var cacheDir = opts.cacheDir;
var flatCache = require( 'flat-cache' );
var fileEntryCache = require( 'file-entry-cache' );
if ( opts.recreate ) {
flatCache.clearCacheById( id, cacheDir );
flatCache.clearCacheById( depsCacheId, cacheDir );
}
// load the cache with id
var cache = flatCache.load( id, cacheDir );
// load the file entry cache with id, or create a new
// one if the previous one doesn't exist
var depsCacheFile = fileEntryCache.create( depsCacheId, cacheDir );
var ignoreCache = false;
// if the command was specified this can be used
// as the cache buster
if ( opts.command ) {
var configHashPersisted = cache.getKey( 'configHash' );
var hashOfConfig = hash( opts.command );
module.exports = function ( browserifyOpts, opts, argv ) {
browserifyOpts = browserifyOpts || { };
opts = opts || { };
var hash = require( 'hash-string' );
var xtend = require( 'xtend' );
var id = 'persistify_' + hash( process.cwd() + trim( opts.cacheId ) );
var depsCacheId = 'deps-cx-' + id;
var cacheDir = opts.cacheDir;
var flatCache = require( 'flat-cache' );
var fileEntryCache = require( 'file-entry-cache' );
if ( opts.recreate ) {
flatCache.clearCacheById( id, cacheDir );
flatCache.clearCacheById( depsCacheId, cacheDir );
}
// load the cache with id
var cache = flatCache.load( id, cacheDir );
// load the file entry cache with id, or create a new
// one if the previous one doesn't exist
var depsCacheFile = fileEntryCache.create( depsCacheId, cacheDir );
var ignoreCache = false;
// if the command was specified this can be used
// as the cache buster
if ( opts.command ) {
var configHashPersisted = cache.getKey( 'configHash' );
var hashOfConfig = hash( opts.command );