@@ -14,146 +14,146 @@ const cases = [
14
14
//
15
15
{
16
16
property : 'property' ,
17
- source : ` export default {}` ,
18
- expected : ` export default { property: "value" }`
17
+ source : ' export default {}' ,
18
+ expected : ' export default { property: "value" }'
19
19
} ,
20
20
{
21
21
property : 'property' ,
22
- source : ` export default { property: 0 }` , // property exists and is a number
23
- expected : ` export default { property: "value" }`
22
+ source : ' export default { property: 0 }' , // property exists and is a number
23
+ expected : ' export default { property: "value" }'
24
24
} ,
25
25
{
26
26
property : 'property' ,
27
- source : ` export default { property: false }` , // property exists and is a boolean
28
- expected : ` export default { property: "value" }`
27
+ source : ' export default { property: false }' , // property exists and is a boolean
28
+ expected : ' export default { property: "value" }'
29
29
} ,
30
30
{
31
31
property : 'property' ,
32
- source : ` export default { property: "test" }` , // property exists and is a string
33
- expected : ` export default { property: "value" }`
32
+ source : ' export default { property: "test" }' , // property exists and is a string
33
+ expected : ' export default { property: "value" }'
34
34
} ,
35
35
{
36
36
property : 'property' ,
37
- source : ` export default { property: [1,2] }` , // property exists and is an array
38
- expected : ` export default { property: "value" }`
37
+ source : ' export default { property: [1,2] }' , // property exists and is an array
38
+ expected : ' export default { property: "value" }'
39
39
} ,
40
40
{
41
41
property : 'property' ,
42
- source : ` export default { property: null }` , // property exists and is null
43
- expected : ` export default { property: "value" }`
42
+ source : ' export default { property: null }' , // property exists and is null
43
+ expected : ' export default { property: "value" }'
44
44
} ,
45
45
{
46
46
property : 'property' ,
47
- source : ` export default { property: {}}` , // property exists and is an object
48
- expected : ` export default { property: "value" }`
47
+ source : ' export default { property: { } }' , // property exists and is an object
48
+ expected : ' export default { property: "value" }'
49
49
} ,
50
50
51
51
// Deep properties (injection 1)
52
52
{
53
53
property : 'property.b.c' ,
54
- source : ` export default {}` ,
55
- expected : ` export default { property: { b: { c: "value" }}}`
54
+ source : ' export default {}' ,
55
+ expected : ' export default { property: { b: { c: "value" } } }'
56
56
} ,
57
57
{
58
58
property : 'property.b.c' ,
59
- source : ` export default { property: 0 }` , // property exists and is a number
60
- expected : ` export default { property: { b: { c: "value" }}}`
59
+ source : ' export default { property: 0 }' , // property exists and is a number
60
+ expected : ' export default { property: { b: { c: "value" } } }'
61
61
} ,
62
62
{
63
63
property : 'property.b.c' ,
64
- source : ` export default { property: {}}` , // property exists and is an object
65
- expected : ` export default { property: { b: { c: "value" }}}`
64
+ source : ' export default { property: { } }' , // property exists and is an object
65
+ expected : ' export default { property: { b: { c: "value" } } }'
66
66
} ,
67
67
68
68
// Deep properties (injection 2)
69
69
{
70
70
property : 'property.b.c' ,
71
- source : ` export default { property: { b: 0 }}` , // property exists and is a number
72
- expected : ` export default { property: { b: { c: "value" }}}`
71
+ source : ' export default { property: { b: 0 } }' , // property exists and is a number
72
+ expected : ' export default { property: { b: { c: "value" } } }'
73
73
} ,
74
74
{
75
75
property : 'property.b.c' ,
76
- source : ` export default { property: { b: {}}}` , // property exists and is an object
77
- expected : ` export default { property: { b: { c: "value" }}}`
76
+ source : ' export default { property: { b: { } } }' , // property exists and is an object
77
+ expected : ' export default { property: { b: { c: "value" } } }'
78
78
} ,
79
79
{
80
80
property : 'property.b.c' ,
81
- source : ` export default { property: { b: { hello: 123}}}` , // property exists and is a non-empty object
82
- expected : ` export default { property: { b: { c: "value", hello: 123 }}}`
81
+ source : ' export default { property: { b: { hello: 123 } } }' , // property exists and is a non-empty object
82
+ expected : ' export default { property: { b: { c: "value", hello: 123 } } }'
83
83
} ,
84
84
85
85
// Deep properties (existing properties)
86
86
{
87
87
property : 'a1.a2' ,
88
- source : ` export default { a2: false, a1: { a3: [12]}}` , // property exists and is a non-empty object
89
- expected : ` export default { a2: false, a1: { a2: "value", a3: [12]}}`
88
+ source : ' export default { a2: false, a1: { a3: [12] } }' , // property exists and is a non-empty object
89
+ expected : ' export default { a2: false, a1: { a2: "value", a3: [12] } }'
90
90
} ,
91
91
92
92
//
93
93
// Indirect default export
94
94
//
95
95
{
96
96
property : 'property' ,
97
- source : ` const config = {}; export default config` ,
98
- expected : ` const config = { property: "value"}; export default config`
97
+ source : ' const config = {}; export default config' ,
98
+ expected : ' const config = { property: "value"}; export default config'
99
99
} ,
100
100
{
101
101
property : 'property' ,
102
- source : ` var config = {}; export default config` ,
103
- expected : ` var config = { property: "value"}; export default config`
102
+ source : ' var config = {}; export default config' ,
103
+ expected : ' var config = { property: "value"}; export default config'
104
104
} ,
105
105
{
106
106
property : 'a.b.c' ,
107
- source : ` var config = {}; export default config` ,
108
- expected : ` var config = { a: { b: { c: "value"}} }; export default config`
107
+ source : ' var config = {}; export default config' ,
108
+ expected : ' var config = { a: { b: { c: "value" } } }; export default config'
109
109
} ,
110
110
{
111
111
property : 'a.b.c' ,
112
- source : ` var config = { a: { b: [], c: "hello"} }; export default config` ,
113
- expected : ` var config = { a: { b: { c: "value"}, c: "hello"} }; export default config`
112
+ source : ' var config = { a: { b: [], c: "hello" } }; export default config' ,
113
+ expected : ' var config = { a: { b: { c: "value"}, c: "hello" } }; export default config'
114
114
} ,
115
115
116
116
//
117
117
// Direct module exports
118
118
//
119
119
{
120
120
property : 'property' ,
121
- source : ` module.exports = {}` ,
122
- expected : ` module.exports = { property: "value"}`
121
+ source : ' module.exports = {}' ,
122
+ expected : ' module.exports = { property: "value"}'
123
123
} ,
124
124
{
125
125
property : 'property' ,
126
- source : ` module.exports = { p1: 0}` ,
127
- expected : ` module.exports = { property: "value", p1: 0}`
126
+ source : ' module.exports = { p1: 0}' ,
127
+ expected : ' module.exports = { property: "value", p1: 0}'
128
128
} ,
129
129
{
130
130
property : 'a.b.c' ,
131
- source : ` module.exports = { p1: 0}` ,
132
- expected : ` module.exports = { a: { b: { c: "value" } }, p1: 0}`
131
+ source : ' module.exports = { p1: 0}' ,
132
+ expected : ' module.exports = { a: { b: { c: "value" } }, p1: 0}'
133
133
} ,
134
134
135
135
//
136
136
// Indirect module exports
137
137
//
138
138
{
139
139
property : 'property' ,
140
- source : ` const config = {}; module.exports = config` ,
141
- expected : ` const config = { property: "value"}; module.exports = config`
140
+ source : ' const config = {}; module.exports = config' ,
141
+ expected : ' const config = { property: "value"}; module.exports = config'
142
142
} ,
143
143
{
144
144
property : 'property' ,
145
- source : ` var config = {}; module.exports = config` ,
146
- expected : ` var config = { property: "value"}; module.exports = config`
145
+ source : ' var config = {}; module.exports = config' ,
146
+ expected : ' var config = { property: "value"}; module.exports = config'
147
147
} ,
148
148
{
149
149
property : 'a.b.c' ,
150
- source : ` var config = {}; module.exports = config` ,
151
- expected : ` var config = { a: { b: { c: "value"}} }; module.exports = config`
150
+ source : ' var config = {}; module.exports = config' ,
151
+ expected : ' var config = { a: { b: { c: "value" } } }; module.exports = config'
152
152
} ,
153
153
{
154
154
property : 'a.b.c' ,
155
- source : ` var config = { a: { b: [], c: "hello"} }; module.exports = config` ,
156
- expected : ` var config = { a: { b: { c: "value"}, c: "hello"} }; module.exports = config`
155
+ source : ' var config = { a: { b: [], c: "hello" } }; module.exports = config' ,
156
+ expected : ' var config = { a: { b: { c: "value"}, c: "hello" } }; module.exports = config'
157
157
}
158
158
]
159
159
0 commit comments