push
travis-ci
442 of 468 relevant lines covered (94.44%)
4299.53 hits per line
1 |
'use stirct'
|
1✔ |
2 |
const vstamp = require('vigour-stamp')
|
1✔ |
3 |
const isObj = require('vigour-util/is/obj')
|
1✔ |
4 |
|
|
5 |
exports.define = { |
1✔ |
6 |
extend: {
|
|
7 |
set (method, val, stamp, nocontext, isNew) { |
|
8 |
const slist = this.root.incomingStamps
|
52,144✔ |
9 |
const obj = isObj(val) |
52,144✔ |
10 |
if (obj) {
|
52,144✔ |
11 |
if (val.stamp) {
|
51,242✔ |
12 |
stamp = val.stamp |
48,084✔ |
13 |
delete val.stamp
|
48,084✔ |
14 |
if (slist && !slist[stamp]) {
|
48,084✔ |
15 |
slist[stamp] = true
|
15,855✔ |
16 |
} |
|
17 |
} |
|
18 |
} |
|
19 |
if (stamp && this.stamp) { |
52,144✔ |
20 |
if (Number(vstamp.val(stamp)) < Number(vstamp.val(this.stamp))) { |
43,506✔ |
21 |
if (!obj) {
|
172✔ |
22 |
return
|
× |
23 |
} else if (val.val) { |
172✔ |
24 |
delete val.val
|
24✔ |
25 |
} |
|
26 |
} |
|
27 |
} |
|
28 |
const changed = method.call(this, val, stamp, nocontext, isNew)
|
52,144✔ |
29 |
return changed
|
52,144✔ |
30 |
} |
|
31 |
} |
|
32 |
} |