prosemirror-state
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -926,6 +926,8 @@ 'use strict'; | ||
// :: (?Object<Plugin>) → Object | ||
// :: (?union<Object<Plugin>, string, number>) → Object | ||
// Serialize this state to JSON. If you want to serialize the state | ||
// of plugins, pass an object mapping property names to use in the | ||
// resulting JSON object to plugin objects. | ||
// resulting JSON object to plugin objects. The argument may also be | ||
// a string or number, in which case it is ignored, to support the | ||
// way `JSON.stringify` calls `toString` methods. | ||
EditorState.prototype.toJSON = function toJSON (pluginFields) { | ||
@@ -935,3 +937,3 @@ var this$1 = this; | ||
var result = {doc: this.doc.toJSON(), selection: this.selection.toJSON()}; | ||
if (pluginFields) { for (var prop in pluginFields) { | ||
if (pluginFields && typeof pluginFields == 'object') { for (var prop in pluginFields) { | ||
if (prop == "doc" || prop == "selection") | ||
@@ -938,0 +940,0 @@ { throw new RangeError("The JSON fields `doc` and `selection` are reserved") } |
{ | ||
"name": "prosemirror-state", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "ProseMirror editor state", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -213,9 +213,11 @@ import {Node} from "prosemirror-model" | ||
// :: (?Object<Plugin>) → Object | ||
// :: (?union<Object<Plugin>, string, number>) → Object | ||
// Serialize this state to JSON. If you want to serialize the state | ||
// of plugins, pass an object mapping property names to use in the | ||
// resulting JSON object to plugin objects. | ||
// resulting JSON object to plugin objects. The argument may also be | ||
// a string or number, in which case it is ignored, to support the | ||
// way `JSON.stringify` calls `toString` methods. | ||
toJSON(pluginFields) { | ||
let result = {doc: this.doc.toJSON(), selection: this.selection.toJSON()} | ||
if (pluginFields) for (let prop in pluginFields) { | ||
if (pluginFields && typeof pluginFields == 'object') for (let prop in pluginFields) { | ||
if (prop == "doc" || prop == "selection") | ||
@@ -222,0 +224,0 @@ throw new RangeError("The JSON fields `doc` and `selection` are reserved") |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157369
1956