push
travis-ci
454 of 480 relevant lines covered (94.58%)
3883.81 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
|
49,961✔ |
9 |
const obj = isObj(val) |
49,961✔ |
10 |
if (obj) {
|
49,961✔ |
11 |
if (val.stamp) {
|
49,433✔ |
12 |
stamp = val.stamp |
46,949✔ |
13 |
delete val.stamp
|
46,949✔ |
14 |
if (slist && !slist[stamp]) {
|
46,949✔ |
15 |
slist[stamp] = true
|
15,553✔ |
16 |
} |
|
17 |
} |
|
18 |
} |
|
19 |
if (stamp && this.stamp) { |
49,961✔ |
20 |
if (Number(vstamp.val(stamp)) < Number(vstamp.val(this.stamp))) { |
42,914✔ |
21 |
console.log('BLOCK', this.path()) |
113✔ |
22 |
if (!obj) {
|
113✔ |
23 |
return
|
× |
24 |
} else if (val.val) { |
113✔ |
25 |
delete val.val
|
9✔ |
26 |
} |
|
27 |
} |
|
28 |
} |
|
29 |
const changed = method.call(this, val, stamp, nocontext, isNew)
|
49,961✔ |
30 |
return changed
|
49,961✔ |
31 |
} |
|
32 |
} |
|
33 |
} |