File tree Expand file tree Collapse file tree 6 files changed +6
-30
lines changed Expand file tree Collapse file tree 6 files changed +6
-30
lines changed Original file line number Diff line number Diff line change 6
6
findAttributeBindings,
7
7
findClassNames,
8
8
findClassNameBindings,
9
- } = require ( '../utils' ) ;
9
+ } = require ( '../utils/classic ' ) ;
10
10
11
11
describe ( 'findTagName()' , ( ) => {
12
12
const TESTS = [
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const {
11
11
findAriaRole,
12
12
isMethod,
13
13
isProperty,
14
- } = require ( '../utils' ) ;
14
+ } = require ( '../utils/classic ' ) ;
15
15
16
16
const EVENT_HANDLER_METHODS = [
17
17
// Touch events
Original file line number Diff line number Diff line change @@ -7,14 +7,12 @@ const {
7
7
addClassDecorator,
8
8
findTagName,
9
9
findElementId,
10
- findDecorator,
11
10
findClassNames,
12
11
findClassNameBindings,
13
12
findAttributeBindings,
14
13
isMethod,
15
14
removeDecorator,
16
15
ensureImport,
17
- removeImport,
18
16
isProperty,
19
17
} = require ( '../utils/native' ) ;
20
18
Original file line number Diff line number Diff line change 1
- const { indentLines } = require ( '../utils' ) ;
1
+ const { indentLines } = require ( '../utils/classic ' ) ;
2
2
3
3
const templateRecast = require ( 'ember-template-recast' ) ;
4
4
Original file line number Diff line number Diff line change 1
1
const j = require ( 'jscodeshift' ) . withParser ( 'ts' ) ;
2
2
3
- const SilentError = require ( './silent-error' ) ;
3
+ const SilentError = require ( '.. /silent-error' ) ;
4
4
5
5
function isProperty ( path , name ) {
6
6
let node = path . value ;
Original file line number Diff line number Diff line change @@ -78,28 +78,8 @@ function findTagName(path) {
78
78
return findStringDecorator ( path , 'tagName' , 'div' ) ;
79
79
}
80
80
81
- function findElementId ( properties ) {
82
- return findStringProperty ( properties , 'elementId' ) ;
83
- }
84
-
85
- function findStringArrayProperties ( properties , name ) {
86
- let propertyPath = properties . filter ( path => isProperty ( path , name ) ) [ 0 ] ;
87
- if ( ! propertyPath ) {
88
- return [ ] ;
89
- }
90
-
91
- let arrayPath = propertyPath . get ( 'value' ) ;
92
- if ( arrayPath . value . type !== 'ArrayExpression' ) {
93
- throw new SilentError ( `Unexpected \`${ name } \` value: ${ j ( arrayPath ) . toSource ( ) } ` ) ;
94
- }
95
-
96
- return arrayPath . get ( 'elements' ) . value . map ( element => {
97
- if ( element . type !== 'StringLiteral' ) {
98
- throw new SilentError ( `Unexpected \`${ name } \` value: ${ j ( arrayPath ) . toSource ( ) } ` ) ;
99
- }
100
-
101
- return element . value ;
102
- } ) ;
81
+ function findElementId ( path ) {
82
+ return findStringProperty ( path , 'elementId' ) ;
103
83
}
104
84
105
85
function findStringArrayDecorator ( path , name ) {
@@ -251,8 +231,6 @@ module.exports = {
251
231
addClassDecorator,
252
232
isProperty,
253
233
isMethod,
254
- findStringProperty,
255
- findStringArrayProperties,
256
234
findAttributeBindings,
257
235
findClassNames,
258
236
findClassNameBindings,
You can’t perform that action at this time.
0 commit comments