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

@liveblocks/react

Package Overview
Dependencies
Maintainers
2
Versions
419
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liveblocks/react - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

37

lib/index.js

@@ -276,6 +276,33 @@ Object.defineProperty(exports, '__esModule', { value: true });

const items = sortedListItems(getListItems(this._cache, id));
const [itemPosition, item] = items[index];
const afterPosition = items[targetIndex][0];
const beforePosition = targetIndex === 0 ? undefined : items[targetIndex - 1][0];
if (targetIndex < 0) {
throw new Error("targetIndex cannont be less than 0");
}
if (targetIndex >= items.length) {
throw new Error("targetIndex cannot be greater or equal than the list length");
}
if (index < 0) {
throw new Error("index cannont be less than 0");
}
if (index >= items.length) {
throw new Error("index cannot be greater or equal than the list length");
}
if (index === targetIndex) {
return this;
}
let beforePosition = null;
let afterPosition = null;
if (index < targetIndex) {
afterPosition =
targetIndex === items.length - 1
? undefined
: items[targetIndex + 1][0];
beforePosition = items[targetIndex][0];
}
else {
afterPosition = items[targetIndex][0];
beforePosition =
targetIndex === 0 ? undefined : items[targetIndex - 1][0];
}
const position = makePosition(beforePosition, afterPosition);
const [, item] = items[index];
return this.dispatch({

@@ -512,6 +539,6 @@ type: OpType.ListMove,

function isRecord(value) {
return typeof value === "object" && value.$$type === RECORD;
return value != null && typeof value === "object" && value.$$type === RECORD;
}
function isList(value) {
return typeof value === "object" && value.$$type === LIST;
return value != null && typeof value === "object" && value.$$type === LIST;
}

@@ -518,0 +545,0 @@ function isCrdt(value) {

4

package.json
{
"name": "@liveblocks/react",
"version": "0.7.0",
"version": "0.7.1",
"description": "",

@@ -16,3 +16,3 @@ "main": "./lib/index.js",

"dependencies": {
"@liveblocks/client": "0.7.0"
"@liveblocks/client": "0.7.1"
},

@@ -19,0 +19,0 @@ "peerDependencies": {

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