Skip to content

Commit

Permalink
ensure .apply is called with array - error with inline object fixes #115
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Jan 15, 2017
1 parent 981e125 commit 31d0290
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/task.tree.transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export const transforms = {

function applyBooleanPropertyToChildren (tasks: Task[], add: boolean, property, value?) {
tasks.forEach(function (task) {
if (add && Array.isArray(task[property])) {
task[property].unshift.apply(task[property], value);
if (add) {
task[property].unshift.apply(task[property], [].concat(value));
}
if (task[property].length) {
if (task.tasks.length) {
Expand Down

0 comments on commit 31d0290

Please sign in to comment.