Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Unit tests for new editor #3247

Merged
merged 15 commits into from
Jul 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/editor/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export function diffDeletion(oldStr, newStr) {
* @param {String} oldValue the previous value
* @param {String} newValue the new value
* @param {Number} caretPosition the position of the caret after `newValue` was applied.
* @return {object}
* @return {object} an object with `at` as the offset where characters were removed and/or added,
* `added` with the added string (if any), and
* `removed` with the removed string (if any)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we seem inconsistent in our jsdoc: sometimes we put newlines directly against the * but other times we indent like this. I'm indifferent, but just something I think we should consider in the future.

*/
export function diffAtCaret(oldValue, newValue, caretPosition) {
const diffLen = newValue.length - oldValue.length;
Expand Down