File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 findAttributeBindings,
77 findClassNames,
88 findClassNameBindings,
9- } = require ( '../utils' ) ;
9+ } = require ( '../utils/classic ' ) ;
1010
1111describe ( 'findTagName()' , ( ) => {
1212 const TESTS = [
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const {
1111 findAriaRole,
1212 isMethod,
1313 isProperty,
14- } = require ( '../utils' ) ;
14+ } = require ( '../utils/classic ' ) ;
1515
1616const EVENT_HANDLER_METHODS = [
1717 // Touch events
Original file line number Diff line number Diff line change @@ -7,14 +7,12 @@ const {
77 addClassDecorator,
88 findTagName,
99 findElementId,
10- findDecorator,
1110 findClassNames,
1211 findClassNameBindings,
1312 findAttributeBindings,
1413 isMethod,
1514 removeDecorator,
1615 ensureImport,
17- removeImport,
1816 isProperty,
1917} = require ( '../utils/native' ) ;
2018
Original file line number Diff line number Diff line change 1- const { indentLines } = require ( '../utils' ) ;
1+ const { indentLines } = require ( '../utils/classic ' ) ;
22
33const templateRecast = require ( 'ember-template-recast' ) ;
44
Original file line number Diff line number Diff line change 11const j = require ( 'jscodeshift' ) . withParser ( 'ts' ) ;
22
3- const SilentError = require ( './silent-error' ) ;
3+ const SilentError = require ( '.. /silent-error' ) ;
44
55function isProperty ( path , name ) {
66 let node = path . value ;
Original file line number Diff line number Diff line change @@ -78,28 +78,8 @@ function findTagName(path) {
7878 return findStringDecorator ( path , 'tagName' , 'div' ) ;
7979}
8080
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' ) ;
10383}
10484
10585function findStringArrayDecorator ( path , name ) {
@@ -251,8 +231,6 @@ module.exports = {
251231 addClassDecorator,
252232 isProperty,
253233 isMethod,
254- findStringProperty,
255- findStringArrayProperties,
256234 findAttributeBindings,
257235 findClassNames,
258236 findClassNameBindings,
You can’t perform that action at this time.
0 commit comments