New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@automerge/automerge

Package Overview
Dependencies
Maintainers
4
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automerge/automerge - npm Package Compare versions

Comparing version 2.1.9 to 2.1.10-alpha.1

38

dist/mjs/next.js

@@ -182,2 +182,40 @@ /**

/**
* Update the value of a string
*
* @typeParam T - The type of the value contained in the document
* @param doc - The document to modify
* @param path - The path to the string to modify
* @param newText - The new text to update the value to
*
* @remarks
* This will calculate a diff between the current value and the new value and
* then convert that diff into calls to {@link splice}. This will produce results
* which don't merge as well as directly capturing the user input actions, but
* sometimes it's not possible to capture user input and this is the best you
* can do.
*
* This is an experimental API and may change in the future.
*
* @beta
*/
export function updateText(doc, path, newText) {
if (!_is_proxy(doc)) {
throw new RangeError("object cannot be modified outside of a change block");
}
const state = _state(doc, false);
const objectId = _obj(doc);
if (!objectId) {
throw new RangeError("invalid object for updateText");
}
_clear_cache(doc);
path.unshift(objectId);
const value = path.join("/");
try {
return state.handle.updateText(value, newText);
}
catch (e) {
throw new RangeError(`Cannot updateText: ${e}`);
}
}
/**
* Returns a cursor for the given position in a string.

@@ -184,0 +222,0 @@ *

@@ -146,2 +146,22 @@ /**

/**
* Update the value of a string
*
* @typeParam T - The type of the value contained in the document
* @param doc - The document to modify
* @param path - The path to the string to modify
* @param newText - The new text to update the value to
*
* @remarks
* This will calculate a diff between the current value and the new value and
* then convert that diff into calls to {@link splice}. This will produce results
* which don't merge as well as directly capturing the user input actions, but
* sometimes it's not possible to capture user input and this is the best you
* can do.
*
* This is an experimental API and may change in the future.
*
* @beta
*/
export declare function updateText(doc: Doc<unknown>, path: stable.Prop[], newText: string): void;
/**
* Returns a cursor for the given position in a string.

@@ -148,0 +168,0 @@ *

4

package.json

@@ -7,3 +7,3 @@ {

],
"version": "2.1.9",
"version": "2.1.10-alpha.1",
"description": "Javascript implementation of automerge, backed by @automerge/automerge-wasm",

@@ -74,5 +74,5 @@ "homepage": "https://github.com/automerge/automerge/tree/main/javascript",

"dependencies": {
"@automerge/automerge-wasm": "0.7.0",
"@automerge/automerge-wasm": "0.8.0",
"uuid": "^9.0.0"
}
}

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