MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / contains

Method contains

tests/helpers/dist-checker.js:77–103  ·  view source on GitHub ↗
(fileType, token)

Source from the content-addressed store, hash-verified

75 }
76
77 contains(fileType, token) {
78 if (!this.dom) {
79 this._evalHtml({});
80 }
81
82 if (fileType === 'js') {
83 for (let element of this.scripts) {
84 let src = element.getAttribute('src');
85 let content = fs.readFileSync(path.join(this.distPath, src), 'utf8');
86
87 if (content.includes(token)) {
88 return true;
89 }
90 }
91 } else if (fileType === 'css') {
92 for (let element of this.links) {
93 let src = element.getAttribute('href');
94 let content = fs.readFileSync(path.join(this.distPath, src), 'utf8');
95
96 if (content.includes(token)) {
97 return true;
98 }
99 }
100 }
101
102 return false;
103 }
104}
105
106module.exports = DistChecker;

Calls 1

_evalHtmlMethod · 0.95

Tested by

no test coverage detected