Skip to content

Commit

Permalink
Accept keepNull parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed May 29, 2021
1 parent c457e83 commit d89b4e3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Delta.ts
Expand Up @@ -7,7 +7,7 @@ import Op from './Op';
const NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()

interface EmbedHandler {
compose<T>(a: T, b: T): T;
compose<T>(a: T, b: T, keepNull: boolean): T;
invert<T>(a: T, b: T): T;
transform<T>(a: T, b: T, priority: boolean): T;
}
Expand Down Expand Up @@ -280,7 +280,11 @@ class Delta {
);
const handler = Delta.getHandler(embedType);
newOp[action] = {
[embedType]: handler.compose(thisData, otherData),
[embedType]: handler.compose(
thisData,
otherData,
action === 'retain',
),
};
}
}
Expand Down

0 comments on commit d89b4e3

Please sign in to comment.