File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
packages/theme/src/cli/utilities Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -85,27 +85,23 @@ function md5(content: string | Buffer) {
8585 * as these are not needed for theme comparison.
8686 */
8787export function rejectGeneratedStaticAssets ( themeChecksums : Checksum [ ] ) {
88+ const liquidAssetKeys = new Set (
89+ themeChecksums
90+ . filter ( ( { key} ) => key . startsWith ( 'assets/' ) && key . endsWith ( '.liquid' ) )
91+ . map ( ( { key} ) => key ) ,
92+ )
93+
8894 return themeChecksums . filter ( ( { key} ) => {
8995 const isStaticAsset = key . startsWith ( 'assets/' )
9096
9197 if ( isStaticAsset ) {
92- return ! hasLiquidSource ( themeChecksums , key )
98+ return ! liquidAssetKeys . has ( ` ${ key } .liquid` )
9399 }
94100
95101 return true
96102 } )
97103}
98104
99- /**
100- * Checks if a given key has a corresponding liquid source in the provided checksums.
101- * @param checksums - The array of checksums to search through.
102- * @param key - The key to check for a liquid source.
103- * @returns True if a liquid source exists for the given key, false otherwise.
104- */
105- function hasLiquidSource ( checksums : Checksum [ ] , key : string ) {
106- return checksums . some ( ( checksum ) => checksum . key === `${ key } .liquid` )
107- }
108-
109105function isSettingsData ( path : string ) {
110106 return path . endsWith ( '/settings_data.json' )
111107}
You can’t perform that action at this time.
0 commit comments