Socket
Socket
Sign inDemoInstall

@liveblocks/client

Package Overview
Dependencies
Maintainers
2
Versions
376
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liveblocks/client - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

37

lib/cjs/doc.js

@@ -130,6 +130,33 @@ "use strict";

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 = position_1.makePosition(beforePosition, afterPosition);
const [, item] = items[index];
return this.dispatch({

@@ -367,6 +394,6 @@ type: live_1.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;
}

@@ -373,0 +400,0 @@ function isCrdt(value) {

@@ -125,6 +125,33 @@ import { OpType, CrdtType, } from "./live";

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({

@@ -361,6 +388,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;
}

@@ -367,0 +394,0 @@ function isCrdt(value) {

2

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

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

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