Skip to content

Commit f427c1b

Browse files
committed
avoiding babel dependency on Symbol
Babel depends on `Symbol` to transpile `for of` and array destructuring. IE doesn't support Symbol, and those 2 ES6 features are better avoided anyway.
1 parent e961d9a commit f427c1b

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsondiffpatch",
3-
"version": "0.3.8",
3+
"version": "0.3.9",
44
"author": "Benjamin Eidelman <beneidel@gmail.com>",
55
"description": "Diff & Patch for Javascript objects",
66
"contributors": [

src/formatters/jsonpatch.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,16 @@ const partition = (arr, pred) => {
140140

141141
const partitionRemovedOps = jsonFormattedDiff => {
142142
const isRemoveOp = ({op}) => op === 'remove';
143-
const removeOpsOtherOps = partition(
143+
return partition(
144144
jsonFormattedDiff,
145145
isRemoveOp
146146
);
147-
return removeOpsOtherOps;
148147
};
149148

150149
const reorderOps = jsonFormattedDiff => {
151-
const [removeOps, otherOps] = partitionRemovedOps(jsonFormattedDiff);
152-
150+
const removeOpsOtherOps = partitionRemovedOps(jsonFormattedDiff);
151+
const removeOps = removeOpsOtherOps[0];
152+
const otherOps = removeOpsOtherOps[1];
153153
const removeOpsReverse = opsByDescendingOrder(removeOps);
154154
return removeOpsReverse.concat(otherOps);
155155
};

src/pipe.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,7 @@ class Pipe {
5555
}
5656

5757
list() {
58-
let names = [];
59-
60-
for (let filter of this.filters) {
61-
names.push(filter.filterName);
62-
}
63-
64-
return names;
58+
return this.filters.map(f => f.filterName);
6559
}
6660

6761
after(filterName) {

0 commit comments

Comments
 (0)