(resource)
| 83 | } |
| 84 | |
| 85 | function checkForDecomposableBundle(resource) { |
| 86 | const isBundle = |
| 87 | resource?.info?.subModules.length > 0 && |
| 88 | !/(?:^|\/)library.js$/.test(resource.info.name); |
| 89 | |
| 90 | if (!isBundle) { |
| 91 | return { |
| 92 | resource, |
| 93 | isBundle, |
| 94 | decomposable: false |
| 95 | }; |
| 96 | } |
| 97 | |
| 98 | return Promise.all( |
| 99 | resource.info.subModules.map((sub) => pool.findResource(sub).catch(() => false)) |
| 100 | ).then((modules) => { |
| 101 | // it might look more natural to expect 'all' embedded modules to exist in the pool, |
| 102 | // but expecting only 'some' module to exist is a more conservative approach |
| 103 | return { |
| 104 | resource, |
| 105 | isBundle, |
| 106 | decomposable: modules.some(($) => ($)) |
| 107 | }; |
| 108 | }); |
| 109 | } |
| 110 | |
| 111 | function checkAndAddResource(resourceName, depth, msg) { |
| 112 | // console.log(" checking " + resourceName + " at depth " + depth); |
nothing calls this directly
no test coverage detected