Skip to content

Commit f0b2f84

Browse files
committed
check for truthiness instead
1 parent 491d21d commit f0b2f84

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

doc/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changelog
22

33

4-
##### 1.3.9 (2015-09-14)
4+
##### 1.3.10 (2015-09-14)
55
- Fix: avoid slicing on an undefined array field in update method.
66

77

lib/common/apply_update.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ export default function applyUpdate (record, update) {
1414

1515
for (let field in update.push) {
1616
const value = update.push[field]
17-
record[field] = field in record ? record[field].slice() : []
17+
record[field] = record[field] ? record[field].slice() : []
1818
if (Array.isArray(value)) record[field].push(...value)
1919
else record[field].push(value)
2020
}
2121

2222
for (let field in update.pull) {
2323
const value = update.pull[field]
24-
record[field] = field in record ?
24+
record[field] = record[field] ?
2525
record[field].slice().filter(exclude.bind(null,
2626
Array.isArray(value) ? value : [ value ])) : []
2727
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "fortune",
33
"description": "High-level I/O for web applications.",
4-
"version": "1.3.9",
4+
"version": "1.3.10",
55
"license": "MIT",
66
"author": {
77
"email": "[email protected]",

0 commit comments

Comments
 (0)