2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-24 19:40:34 +03:00

chore: small readability improvement

This commit is contained in:
pimlie
2019-02-22 20:01:42 +01:00
parent 66275109e2
commit 4968ee10b9
+4 -3
View File
@@ -2,14 +2,15 @@ import isArray from './isArray'
import { isObject } from './typeof' import { isObject } from './typeof'
export function ensureIsArray(arg, key) { export function ensureIsArray(arg, key) {
if (key && isObject(arg)) { if (isObject(arg) && key) {
if (!isArray(arg[key])) { if (!isArray(arg[key])) {
arg[key] = [] arg[key] = []
} }
return arg return arg
} else {
return isArray(arg) ? arg : []
} }
return isArray(arg) ? arg : []
} }
export function ensuredPush(object, key, el) { export function ensuredPush(object, key, el) {