function stripHash(regex) {
	if (regex) {
		console.log(`Striping hash from build chunks using '${regex}' pattern.`);
		return function (fileName) {
			return fileName.replace(new RegExp(regex), (str, ...hashes) => {
				hashes = hashes.slice(0, -2).filter((c) => c != null);
				if (hashes.length) {
					for (let i = 0; i < hashes.length; i++) {
						const hash = hashes[i] || '';
						str = str.replace(hash, hash.replace(/./g, '*'));
					}
					return str;
				}
				return '';
			});
		};
	}

	return undefined;
}
/**
 * Remove any matched hash patterns from a filename string.
 * @param {string=} regex
 * @returns {(((fileName: string) => string) | undefined)}
 */
Remove any matched hash patterns from a filename string.
Remove any matched hash patterns from a filename string .
function stripHash(regex) {
	if (regex) {
		console.log(`Striping hash from build chunks using '${regex}' pattern.`);
		return function (fileName) {
			return fileName.replace(new RegExp(regex), (str, ...hashes) => {
				hashes = hashes.slice(0, -2).filter((c) => c != null);
				if (hashes.length) {
					for (let i = 0; i < hashes.length; i++) {
						const hash = hashes[i] || '';
						str = str.replace(hash, hash.replace(/./g, '*'));
					}
					return str;
				}
				return '';
			});
		};
	}
	return undefined;
}
function stripHash ( regex ) { if ( regex ) { console . log ( ` ${ regex } ` ) ; return function ( fileName ) { return fileName . replace ( new RegExp ( regex ) , ( str , ... hashes ) => { hashes = hashes . slice ( 0 , - 2 ) . filter ( ( c ) => c != null ) ; if ( hashes . length ) { for ( let i = 0 ; i < hashes . length ; i ++ ) { const hash = hashes [ i ] || '' ; str = str . replace ( hash , hash . replace ( / . / g , '*' ) ) ; } return str ; } return '' ; } ) ; } ; } return undefined ; }
Remove any matched hash patterns from a filename string.
Remove any matched hash patterns from a filename string .