diff options
author | cel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519> | 2020-03-23 15:13:58 -0400 |
---|---|---|
committer | cel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519> | 2020-03-28 13:55:24 -0400 |
commit | e3e4ed19ef47bbbd8a0236011b5d4bf131eed048 (patch) | |
tree | e469ec3262387a7ed6c2f4d6b324ebbe1d014cef /lib/util.js | |
parent | 661eff54f83248fe168f066648b88112109e1e29 (diff) | |
download | patchfoo-e3e4ed19ef47bbbd8a0236011b5d4bf131eed048.tar.gz patchfoo-e3e4ed19ef47bbbd8a0236011b5d4bf131eed048.zip |
Fix sorting by claimed timestamp
Diffstat (limited to 'lib/util.js')
-rw-r--r-- | lib/util.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/util.js b/lib/util.js index c5584ee..519289a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -220,14 +220,11 @@ u.pullSlice = function (start, end) { } u.mergeOpts = function (a, b) { + if (typeof b !== 'object' || b === null) return b + if (typeof a !== 'object' || a === null) return a var obj = {}, k - for (k in a) { - obj[k] = a[k] - } - for (k in b) { - if (b[k] != null) obj[k] = b[k] - else delete obj[k] - } + for (k in a) obj[k] = k in b ? u.mergeOpts(a[k], b[k]) : a[k] + for (k in b) if (!(k in a) && b[k] != null) obj[k] = b[k] return obj } |