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.4.9 to 0.4.10

2

dist/common.d.ts

@@ -29,3 +29,1 @@ export declare const DEFAULT_LAYOUT: {

export declare const buildStateTokenIndexKey: (startIndex: number, endIndex: number) => string;
export declare function findLastIndex(arr: Array<any>, fn: Function): number;
export declare function getByValue(map: any, searchValue: any): any;

4

package.json
{
"name": "@infinite-list/data-model",
"version": "0.4.9",
"version": "0.4.10",
"files": [

@@ -23,2 +23,4 @@ "dist",

"@x-oasis/default-boolean-value": "^0.1.14",
"@x-oasis/find-last-index": "^0.1.34",
"@x-oasis/get-map-key-by-value": "^0.1.34",
"@x-oasis/is-clamped": "^0.1.14",

@@ -25,0 +27,0 @@ "@x-oasis/layout-equal": "^0.1.16",

@@ -63,34 +63,1 @@ export const DEFAULT_LAYOUT = {

`space_${startIndex}_${endIndex}`;
export function findLastIndex(arr: Array<any>, fn: Function) {
// @ts-ignore
if (Array.prototype.findLastIndex) return arr.findIndex(fn);
const len = arr.length;
for (let index = len - 1; index > 0; index--) {
if (fn.apply(arr, [arr[index], index, arr])) {
return index;
}
}
return -1;
}
// Array.prototype.myfindLastIndex = function(fn) {
// const context = this
// const len = this.length
// for (let index = len -1; index > 0; index--) {
// if (fn.apply(context, [context[index], index, context])) {
// return index
// }
// }
// return -1
// }
// https://stackoverflow.com/questions/47135661/how-can-i-get-a-key-in-a-javascript-map-by-its-value
export function getByValue(map, searchValue) {
for (const [key, value] of map.entries()) {
if (value === searchValue) return key;
}
}

@@ -9,3 +9,3 @@ import shallowArrayEqual from '@x-oasis/shallow-array-equal';

} from './types';
import { findLastIndex } from './common'
import findLastIndex from '@x-oasis/find-last-index';
import ListGroupDimensions from './ListGroupDimensions';

@@ -12,0 +12,0 @@

import Batchinator from '@x-oasis/batchinator';
import defaultBooleanValue from '@x-oasis/default-boolean-value';
import noop from '@x-oasis/noop';
import { getByValue } from './common';
import getMapKeyByValue from '@x-oasis/get-map-key-by-value';
import { StateEventListener, ItemMetaStateEventHelperProps } from './types';

@@ -212,3 +212,3 @@

this._handleCountMap.set(handler, value + 1);
const key = getByValue(this._reusableStrictEventListenerMap, handler);
const key = getMapKeyByValue(this._reusableStrictEventListenerMap, handler);
if (key) {

@@ -215,0 +215,0 @@ const _value = this._strictListenerKeyToHandleCountMap[key] || 0;

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