1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = getAttrsWithChangesRecorder;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | function getAttrsWithChangesRecorder(getAttrs, options) {
|
19 | var changes = [];
|
20 | function getAttrsWithChangesRecorder(prevAttrs, node) {
|
21 | var newAttrs = getAttrs(prevAttrs, node);
|
22 | changes.push({
|
23 | node: node,
|
24 | prevAttrs: prevAttrs,
|
25 | newAttrs: newAttrs,
|
26 | options: options
|
27 | });
|
28 | return newAttrs;
|
29 | }
|
30 | return {
|
31 | getAttrs: getAttrsWithChangesRecorder,
|
32 | getAndResetAttrsChanges: function getAndResetAttrsChanges() {
|
33 | var oldChanges = changes;
|
34 | changes = [];
|
35 | return oldChanges;
|
36 | }
|
37 | };
|
38 | } |
\ | No newline at end of file |