From 44e466119882c4dcc798e6d85b8304f7770d3901 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 30 Jul 2019 12:34:30 +0200 Subject: [PATCH] document return type --- src/editor/diff.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/editor/diff.js b/src/editor/diff.js index b6839b1a88..27d10689b3 100644 --- a/src/editor/diff.js +++ b/src/editor/diff.js @@ -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) */ export function diffAtCaret(oldValue, newValue, caretPosition) { const diffLen = newValue.length - oldValue.length;