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

@infinite-list/data-model

Package Overview
Dependencies
Maintainers
1
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@infinite-list/data-model - npm Package Compare versions

Comparing version 0.1.1-recycle-alpha.2 to 0.1.1-recycle-alpha.3

1

dist/struct/IntegerBufferSet.d.ts

@@ -13,2 +13,3 @@ import Heap from './Heap';

getSize(): number;
get indices(): any[];
getValuePosition(value: number): null | number;

@@ -15,0 +16,0 @@ getNewPositionForValue(value: number): number;

2

package.json
{
"name": "@infinite-list/data-model",
"version": "0.1.1-recycle-alpha.2",
"version": "0.1.1-recycle-alpha.3",
"files": [

@@ -5,0 +5,0 @@ "dist",

@@ -907,3 +907,4 @@ import noop from '@x-oasis/noop';

const targetIndices = [];
const targetIndices = this._bufferSet.indices;
const scrolling = actionType === 'scrollDown' || actionType === 'scrollUp';

@@ -914,21 +915,29 @@

for (let index = bufferedStartIndex; index < visibleStartIndex; index++) {
const position = this.getPosition(
index,
bufferedStartIndex,
visibleStartIndex
);
if (position !== null) targetIndices[position] = index;
if (visibleEndIndex >= 0) {
for (let index = visibleStartIndex; index <= visibleEndIndex; index++) {
const position = this.getPosition(
index,
visibleStartIndex,
visibleEndIndex
);
if (position !== null) targetIndices[position] = index;
}
}
if (bufferedEndIndex >= 0) {
for (
let index = visibleEndIndex + 1;
index <= bufferedEndIndex;
index++
) {
const bufferSize = Math.floor(
(this.recycleThreshold -
Math.max(visibleEndIndex - visibleStartIndex, 0)) /
2
);
for (
let index = visibleStartIndex, size = bufferSize;
size >= 0;
size--, index--
) {
if (index >= 0) {
const position = this.getPosition(
index,
visibleEndIndex + 1,
bufferedEndIndex
bufferedStartIndex,
visibleStartIndex
);

@@ -939,8 +948,12 @@ if (position !== null) targetIndices[position] = index;

if (visibleEndIndex >= 0) {
for (let index = visibleStartIndex; index <= visibleEndIndex; index++) {
for (
let index = visibleEndIndex + 1, size = bufferSize;
size >= 0;
size--, index++
) {
if (index >= 0) {
const position = this.getPosition(
index,
visibleStartIndex,
visibleEndIndex
visibleEndIndex + 1,
bufferedEndIndex
);

@@ -947,0 +960,0 @@ if (position !== null) targetIndices[position] = index;

@@ -45,2 +45,11 @@ // import invariant from 'invariant';

get indices() {
const indices = [];
for (const key in this._valueToPositionMap) {
const value = this._valueToPositionMap[key];
indices[value] = key;
}
return indices;
}
getValuePosition(value: number): null | number {

@@ -47,0 +56,0 @@ if (this._valueToPositionMap[value] === undefined) {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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