Skip to content

Commit

Permalink
Extend support for differential updates to imported lists
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Dec 19, 2023
1 parent d13cd30 commit 443c1f8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/js/assets.js
Expand Up @@ -1204,8 +1204,19 @@ const getAssetDiffDetails = assetKey => {
out.writeTime = cacheEntry.writeTime;
const assetEntry = assetSourceRegistry[assetKey];
if ( assetEntry === undefined ) { return; }
if ( Array.isArray(assetEntry.cdnURLs) === false ) { return; }
out.cdnURLs = assetEntry.cdnURLs.slice();
if ( Array.isArray(assetEntry.cdnURLs) ) {
out.cdnURLs = assetEntry.cdnURLs.slice();
} else if ( reIsExternalPath.test(assetKey) ) {
out.cdnURLs = [ assetKey ];
} else if ( typeof assetEntry.contentURL === 'string' ) {
out.cdnURLs = [ assetEntry.contentURL ];
} else if ( Array.isArray(assetEntry.contentURL) ) {
out.cdnURLs = assetEntry.contentURL.slice(0).filter(url =>
reIsExternalPath.test(url)
);
}
if ( Array.isArray(out.cdnURLs) === false ) { return; }
if ( out.cdnURLs.length === 0 ) { return; }
return out;
};

Expand Down

0 comments on commit 443c1f8

Please sign in to comment.