-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (21 loc) · 686 Bytes
/
index.js
File metadata and controls
25 lines (21 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const stringUtil = require('ember-cli-string-utils');
function invocationFor(options) {
let parts = options.entity.name.split('/');
return parts.map((p) => stringUtil.classify(p)).join('::');
}
module.exports = {
locals: function (options) {
let templateInvocation = invocationFor(options);
let componentName = templateInvocation;
let openComponent = (descriptor) => `<${descriptor}>`;
let closeComponent = (descriptor) => `</${descriptor}>`;
let selfCloseComponent = (descriptor) => `<${descriptor} />`;
return {
name: options.project.name(),
componentName,
openComponent,
closeComponent,
selfCloseComponent,
};
}
}