Compare 7bec7dd ... +1 ... 57721d9

Coverage Reach

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 5 files from the diff.
Other files ignored by Codecov

@@ -1,10 +1,21 @@
Loading
1 -
import { Vue, VueConstructor, Option } from './interfaces'
1 +
import {
2 +
	Vue,
3 +
	VueConstructor,
4 +
	Option,
5 +
	StorageOptionWithFactory,
6 +
	StorageOption,
7 +
} from './interfaces'
2 8
import { set, copy } from './objpath'
3 9
import { localStorage } from './drivers'
4 10
import defaultMerge from './merge'
5 11
6 12
function applyPersistence(vm, option: Option) {
7 -
	const { keys, merge = defaultMerge, namespace: ns, driver = localStorage } = option
13 +
	const {
14 +
		keys,
15 +
		merge = defaultMerge,
16 +
		namespace: ns,
17 +
		driver = localStorage,
18 +
	} = option
8 19
9 20
	let originaldata = {}
10 21
	for (const k of keys) {
@@ -26,11 +37,11 @@
Loading
26 37
	for (const k of keys) {
27 38
		copy(vm, data, k)
28 39
		vm.$watch(k, {
29 -
			handler: value => {
40 +
			handler: (value) => {
30 41
				set(data, k, value)
31 42
				driver.set(ns, data)
32 43
			},
33 -
			deep: true
44 +
			deep: true,
34 45
		})
35 46
	}
36 47
}
@@ -39,10 +50,14 @@
Loading
39 50
	Vue.mixin({
40 51
		created() {
41 52
			if ('storage' in this.$options) {
42 -
				const option: Option | Option[] = this.$options.storage
43 -
				if (Array.isArray(option)) option.forEach(opt => applyPersistence(this, opt))
53 +
				let option: StorageOptionWithFactory = this.$options.storage
54 +
				if (typeof option === 'function') {
55 +
					option = option.apply(this) as StorageOption
56 +
				}
57 +
				if (Array.isArray(option))
58 +
					option.forEach((opt) => applyPersistence(this, opt))
44 59
				else applyPersistence(this, option)
45 60
			}
46 -
		}
61 +
		},
47 62
	})
48 63
}

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
src 100.00%
Project Totals (6 files) 100.00%
Loading