slate 0.81.3 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +4 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/editor.d.ts.map +1 -1
- package/dist/slate.js +4 -1
- package/dist/slate.min.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1413,13 +1413,16 @@ var Editor = {
|
|
|
1413
1413
|
* Check if a value is an `Editor` object.
|
|
1414
1414
|
*/
|
|
1415
1415
|
isEditor: function isEditor(value) {
|
|
1416
|
-
if (!isPlainObject.isPlainObject(value)) return false;
|
|
1417
1416
|
var cachedIsEditor = IS_EDITOR_CACHE.get(value);
|
|
1418
1417
|
|
|
1419
1418
|
if (cachedIsEditor !== undefined) {
|
|
1420
1419
|
return cachedIsEditor;
|
|
1421
1420
|
}
|
|
1422
1421
|
|
|
1422
|
+
if (!isPlainObject.isPlainObject(value)) {
|
|
1423
|
+
return false;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1423
1426
|
var isEditor = typeof value.addMark === 'function' && typeof value.apply === 'function' && typeof value.deleteBackward === 'function' && typeof value.deleteForward === 'function' && typeof value.deleteFragment === 'function' && typeof value.insertBreak === 'function' && typeof value.insertSoftBreak === 'function' && typeof value.insertFragment === 'function' && typeof value.insertNode === 'function' && typeof value.insertText === 'function' && typeof value.isInline === 'function' && typeof value.isVoid === 'function' && typeof value.normalizeNode === 'function' && typeof value.onChange === 'function' && typeof value.removeMark === 'function' && (value.marks === null || isPlainObject.isPlainObject(value.marks)) && (value.selection === null || Range.isRange(value.selection)) && Node.isNodeList(value.children) && Operation.isOperationList(value.operations);
|
|
1424
1427
|
IS_EDITOR_CACHE.set(value, isEditor);
|
|
1425
1428
|
return isEditor;
|