@@ -29,14 +29,14 @@ function diffTable (target, mixin, head) {
29
29
head = [ chalk . grey ( 'Name' ) , chalk . yellow ( 'Old' ) , chalk . green ( 'New' ) ] ;
30
30
}
31
31
32
- var table = new Table ( {
32
+ const table = new Table ( {
33
33
head : head
34
34
} ) ;
35
35
36
- for ( var propName in target ) {
36
+ for ( const propName in target ) {
37
37
if ( propName in mixin ) {
38
- var targetPropValue = target [ propName ] ;
39
- var mixinPropValue = mixin [ propName ] ;
38
+ const targetPropValue = target [ propName ] ;
39
+ const mixinPropValue = mixin [ propName ] ;
40
40
// If found and is not equal
41
41
if ( targetPropValue !== mixinPropValue ) {
42
42
table . push ( [ propName , targetPropValue , mixinPropValue ] ) ;
@@ -49,7 +49,7 @@ function diffTable (target, mixin, head) {
49
49
50
50
function promptYesOrNo ( ) {
51
51
return new Promise ( function ( resolve , reject ) {
52
- var property = {
52
+ const property = {
53
53
name : 'answer' ,
54
54
message : chalk . yellow ( 'Would you like to continue? [Y/n]' )
55
55
} ;
@@ -121,12 +121,12 @@ if (fs.existsSync('elm-package.json') === false) {
121
121
122
122
if ( fs . existsSync ( './package.json' ) === true ) {
123
123
console . log ( 'Found existing package.json' ) ;
124
- var pkgEjected = JSON . parse ( fs . readFileSync ( './package.json' , { encoding : 'utf-8' } ) ) ;
124
+ const pkgEjected = JSON . parse ( fs . readFileSync ( './package.json' , { encoding : 'utf-8' } ) ) ;
125
125
126
126
Promise . resolve ( )
127
127
. then ( function ( ) {
128
128
if ( pkgEjected . hasOwnProperty ( 'devDependencies' ) ) {
129
- var diff = diffTable ( pkgEjected . devDependencies , devDependencies ) ;
129
+ const diff = diffTable ( pkgEjected . devDependencies , devDependencies ) ;
130
130
if ( diff . length !== 0 ) {
131
131
console . log ( diff . toString ( ) ) ;
132
132
console . log ( 'Ejecting wil overwrite your "devDependencies" in package.json\n' ) ;
@@ -136,7 +136,7 @@ if (fs.existsSync('./package.json') === true) {
136
136
} )
137
137
. then ( function ( ) {
138
138
if ( pkgEjected . hasOwnProperty ( 'scripts' ) && Object . keys ( pkgEjected . scripts ) . length === 0 ) {
139
- var diff = diffTable ( pkgEjected . scripts , scripts ) ;
139
+ const diff = diffTable ( pkgEjected . scripts , scripts ) ;
140
140
if ( diff . length !== 0 ) {
141
141
console . log ( diff . toString ( ) ) ;
142
142
console . log ( 'Ejecting will overwrite your "scripts" in package.json\n' ) ;
0 commit comments