We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a13fd6 commit 2e35046Copy full SHA for 2e35046
src/core/util/options.js
@@ -253,19 +253,12 @@ function normalizeProps (options: Object) {
253
*/
254
function normalizeInject (options: Object) {
255
const inject = options.inject
256
- if (!Array.isArray(inject)) return
257
- const res = {}
258
- let i = inject.length
259
- let val
260
- while (i--) {
261
- val = inject[i]
262
- if (typeof val === 'string') {
263
- res[val] = val
264
- } else if (process.env.NODE_ENV !== 'production') {
265
- warn('inject must be strings when using array syntax.')
+ if (Array.isArray(inject)) {
+ const normalized = options.inject = {}
+ for (let i = 0; i < inject.length; i++) {
+ normalized[inject[i]] = inject[i]
266
}
267
268
- options.inject = res
269
270
271
/**
0 commit comments