Skip to content

Commit 45cfeca

Browse files
committed
Cleanup
1 parent 1a292b0 commit 45cfeca

File tree

5 files changed

+11
-28
lines changed

5 files changed

+11
-28
lines changed

lib/transform/native.js

-10
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,6 @@ module.exports = function transformNativeComponent(root, options) {
122122
// set `@tagName('')`
123123
addClassDecorator(exportDefaultDeclaration, 'tagName', [j.stringLiteral('')]);
124124
ensureImport(root, 'tagName', '@ember-decorators/component');
125-
// let tagNamePath = j(classBody)
126-
// .find(j.ClassProperty)
127-
// // .filter(path => path.parentPath === properties)
128-
// .filter(path => isProperty(path, 'tagName'));
129-
//
130-
// if (tagNamePath.length === 1) {
131-
// j(tagNamePath.get('value')).replaceWith(j.stringLiteral(''));
132-
// } else {
133-
// classBody.unshift(j.classProperty(j.identifier('tagName'), j.stringLiteral('')));
134-
// }
135125

136126
// remove `elementId`, `attributeBindings`, `classNames` and `classNameBindings`
137127
j(classBody)

lib/transform/template.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { indentLines } = require('../utils/classic');
1+
const { indentLines } = require('../utils/template');
22

33
const templateRecast = require('ember-template-recast');
44

lib/utils/classic.js

-8
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,6 @@ function findClassNameBindings(properties) {
8787
return classNameBindings;
8888
}
8989

90-
function indentLines(content) {
91-
return content
92-
.split('\n')
93-
.map(it => ` ${it}`)
94-
.join('\n');
95-
}
96-
9790
module.exports = {
9891
isProperty,
9992
isMethod,
@@ -104,5 +97,4 @@ module.exports = {
10497
findClassNameBindings,
10598
findElementId,
10699
findTagName,
107-
indentLines,
108100
};

lib/utils/native.js

-9
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,6 @@ function removeDecorator(root, classDeclaration, name, source) {
178178
}
179179
}
180180

181-
function indentLines(content) {
182-
return content
183-
.split('\n')
184-
.map(it => ` ${it}`)
185-
.join('\n');
186-
}
187-
188181
function ensureImport(root, name, source) {
189182
let body = root.get().value.program.body;
190183

@@ -225,7 +218,6 @@ function removeImport(root, name, source) {
225218
.remove();
226219

227220
if (declaration.get().value.specifiers.length === 0) {
228-
// console.log(root.get('program', 'body'))
229221
declaration.remove();
230222
}
231223
}
@@ -278,5 +270,4 @@ module.exports = {
278270
removeDecorator,
279271
ensureImport,
280272
removeImport,
281-
indentLines,
282273
};

lib/utils/template.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
function indentLines(content) {
2+
return content
3+
.split('\n')
4+
.map(it => ` ${it}`)
5+
.join('\n');
6+
}
7+
8+
module.exports = {
9+
indentLines,
10+
};

0 commit comments

Comments
 (0)