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

@blocksuite/store

Package Overview
Dependencies
Maintainers
5
Versions
1256
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocksuite/store - npm Package Compare versions

Comparing version 0.4.0-20230110000526-9d95ace to 0.4.0-20230110112105-ef07332

17

dist/text-adapter.js

@@ -161,4 +161,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

sliceToDelta(begin, end) {
const result = [];
if (end && begin >= end) {
return [];
return result;
}

@@ -169,3 +170,2 @@ const delta = this.toDelta();

}
const result = [];
if (delta && delta instanceof Array) {

@@ -177,9 +177,8 @@ let charNum = 0;

const contentLen = contentText.length;
if (end && charNum + contentLen > end) {
contentText = contentText.slice(0, end - charNum);
}
if (charNum + contentLen > begin && result.length === 0) {
contentText = contentText.slice(begin - charNum);
}
if (charNum + contentLen > begin && result.length === 0) {
const isLastOp = end && charNum + contentLen > end;
const isFirstOp = charNum + contentLen > begin && result.length === 0;
if (isFirstOp || isLastOp) {
contentText = isLastOp
? contentText.slice(0, end - charNum)
: contentText.slice(begin - charNum);
result.push({

@@ -186,0 +185,0 @@ ...content,

{
"name": "@blocksuite/store",
"version": "0.4.0-20230110000526-9d95ace",
"version": "0.4.0-20230110112105-ef07332",
"description": "BlockSuite data store built for general purpose state management.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -234,4 +234,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

sliceToDelta(begin: number, end?: number) {
const result: DeltaOperation[] = [];
if (end && begin >= end) {
return [];
return result;
}

@@ -243,16 +244,18 @@

}
const result = [];
if (delta && delta instanceof Array) {
let charNum = 0;
for (let i = 0; i < delta.length; i++) {
const content = delta[i];
let contentText = content.insert || '';
const content: DeltaOperation = delta[i];
let contentText: string = content.insert || '';
const contentLen = contentText.length;
if (end && charNum + contentLen > end) {
contentText = contentText.slice(0, end - charNum);
}
if (charNum + contentLen > begin && result.length === 0) {
contentText = contentText.slice(begin - charNum);
}
if (charNum + contentLen > begin && result.length === 0) {
const isLastOp = end && charNum + contentLen > end;
const isFirstOp = charNum + contentLen > begin && result.length === 0;
if (isFirstOp || isLastOp) {
contentText = isLastOp
? contentText.slice(0, end - charNum)
: contentText.slice(begin - charNum);
result.push({

@@ -265,5 +268,7 @@ ...content,

}
if (end && charNum + contentLen > end) {
break;
}
charNum = charNum + contentLen;

@@ -270,0 +275,0 @@ }

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