1 | const SHOULD_INCLUDE_HELPERS = new WeakMap();
|
2 |
|
3 | function shouldIncludeHelpers(addonOrProject) {
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | if (addonOrProject.pkg && addonOrProject.pkg.name === '@ember-decorators/babel-transforms') {
|
12 | return true;
|
13 | }
|
14 |
|
15 | if (addonOrProject.addons) {
|
16 | return addonOrProject.addons.some(shouldIncludeHelpers);
|
17 | }
|
18 |
|
19 | return false;
|
20 | }
|
21 |
|
22 |
|
23 | module.exports = function defaultShouldIncludeHelpers(project) {
|
24 | if (SHOULD_INCLUDE_HELPERS.has(project)) {
|
25 | return SHOULD_INCLUDE_HELPERS.get(project);
|
26 | }
|
27 |
|
28 | let shouldInclude = shouldIncludeHelpers(project);
|
29 |
|
30 | SHOULD_INCLUDE_HELPERS.set(project, shouldInclude);
|
31 |
|
32 | return shouldInclude;
|
33 | }
|
34 |
|