Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

yjs

Package Overview
Dependencies
Maintainers
1
Versions
286
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yjs - npm Package Compare versions

Comparing version 13.5.21 to 13.5.22

7

dist/src/utils/Doc.d.ts

@@ -10,2 +10,3 @@ export const generateNewClientId: typeof random.uint32;

* @property {boolean} [DocOpts.autoLoad] If a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.
* @property {boolean} [DocOpts.shouldLoad] Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load()
*/

@@ -20,3 +21,3 @@ /**

*/
constructor({ guid, collectionid, gc, gcFilter, meta, autoLoad }?: DocOpts | undefined);
constructor({ guid, collectionid, gc, gcFilter, meta, autoLoad, shouldLoad }?: DocOpts | undefined);
gc: boolean;

@@ -168,2 +169,6 @@ gcFilter: (arg0: Item) => boolean;

autoLoad?: boolean | undefined;
/**
* Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load()
*/
shouldLoad?: boolean | undefined;
};

@@ -170,0 +175,0 @@ import * as random from "lib0/random";

2

package.json
{
"name": "yjs",
"version": "13.5.21",
"version": "13.5.22",
"description": "Shared Editing Library",

@@ -5,0 +5,0 @@ "main": "./dist/yjs.cjs",

@@ -9,2 +9,8 @@

/**
* @param {string} guid
* @param {Object<string, any>} opts
*/
const createDocFromOpts = (guid, opts) => new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false })
/**
* @private

@@ -65,3 +71,3 @@ */

copy () {
return new ContentDoc(this.doc)
return new ContentDoc(createDocFromOpts(this.doc.guid, this.opts))
}

@@ -137,2 +143,2 @@

*/
export const readContentDoc = decoder => new ContentDoc(new Doc({ guid: decoder.readString(), ...decoder.readAny() }))
export const readContentDoc = decoder => new ContentDoc(createDocFromOpts(decoder.readString(), decoder.readAny()))

@@ -31,2 +31,3 @@ /**

* @property {boolean} [DocOpts.autoLoad] If a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.
* @property {boolean} [DocOpts.shouldLoad] Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load()
*/

@@ -42,3 +43,3 @@

*/
constructor ({ guid = random.uuidv4(), collectionid = null, gc = true, gcFilter = () => true, meta = null, autoLoad = false } = {}) {
constructor ({ guid = random.uuidv4(), collectionid = null, gc = true, gcFilter = () => true, meta = null, autoLoad = false, shouldLoad = true } = {}) {
super()

@@ -72,3 +73,3 @@ this.gc = gc

this._item = null
this.shouldLoad = autoLoad
this.shouldLoad = shouldLoad
this.autoLoad = autoLoad

@@ -254,12 +255,8 @@ this.meta = meta

const content = /** @type {ContentDoc} */ (item.content)
if (item.deleted) {
// @ts-ignore
content.doc = null
} else {
content.doc = new Doc({ guid: this.guid, ...content.opts })
content.doc._item = item
}
content.doc = new Doc({ guid: this.guid, ...content.opts, shouldLoad: false })
content.doc._item = item
transact(/** @type {any} */ (item).parent.doc, transaction => {
const doc = content.doc
if (!item.deleted) {
transaction.subdocsAdded.add(content.doc)
transaction.subdocsAdded.add(doc)
}

@@ -266,0 +263,0 @@ transaction.subdocsRemoved.add(this)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc