New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@x-oasis/recycler

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@x-oasis/recycler - npm Package Compare versions

Comparing version 0.1.35 to 0.1.36

10

dist/index.d.ts
import IntegerBufferSet from '@x-oasis/integer-buffer-set';
import { OnRecyclerProcess, RecyclerProps, SafeRange } from './types';
export { OnRecyclerProcess, RecyclerProps };
declare class Recycler {
declare class Recycler<ItemMeta = any> {
private _queue;

@@ -14,8 +14,8 @@ private _thresholdIndexValue;

constructor(props?: RecyclerProps);
get queue(): IntegerBufferSet<any>[];
get queue(): IntegerBufferSet<ItemMeta>[];
get thresholdIndexValue(): number;
get recyclerReservedBufferPerBatch(): number;
getIndices(): any[];
addBuffer(type: string): IntegerBufferSet<any>;
ensureBuffer(type: string): IntegerBufferSet<any>;
getIndices(): import("@x-oasis/integer-buffer-set/dist/types").BufferIndicesItem<ItemMeta>[];
addBuffer(type: string): IntegerBufferSet<ItemMeta>;
ensureBuffer(type: string): IntegerBufferSet<ItemMeta>;
reset(): void;

@@ -22,0 +22,0 @@ updateIndices(props: {

{
"name": "@x-oasis/recycler",
"version": "0.1.35",
"version": "0.1.36",
"description": "IntegerBufferSet function",

@@ -18,4 +18,7 @@ "main": "dist/index.js",

},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@x-oasis/integer-buffer-set": "0.1.35"
"@x-oasis/integer-buffer-set": "0.1.36"
},

@@ -22,0 +25,0 @@ "scripts": {

@@ -1,3 +0,3 @@

import IntegerBufferSet from '@x-oasis/integer-buffer-set';
import { OnRecyclerProcess, RecyclerProps, SafeRange, ItemMeta } from './types';
import IntegerBufferSet, { IndicesItem } from '@x-oasis/integer-buffer-set';
import { OnRecyclerProcess, RecyclerProps, SafeRange } from './types';
import {

@@ -11,4 +11,4 @@ DEFAULT_RECYCLER_TYPE,

class Recycler {
private _queue: Array<IntegerBufferSet> = [];
class Recycler<ItemMeta = any> {
private _queue: IntegerBufferSet<ItemMeta>[] = [];

@@ -24,4 +24,4 @@ /**

private _recyclerBufferSize: number;
private _metaExtractor: (index: number) => any;
private _indexExtractor: (meta: any) => number;
private _metaExtractor: (index: number) => ItemMeta;
private _indexExtractor: (meta: ItemMeta) => number;
private _getType: (index: number) => string;

@@ -65,3 +65,6 @@ private _getMetaType: (meta: ItemMeta) => string;

getIndices() {
return this._queue.reduce((acc, cur) => acc.concat(cur.getIndices()), []);
return this._queue.reduce<IndicesItem<ItemMeta>[]>(
(acc, cur) => acc.concat(cur.getIndices()),
[]
);
}

@@ -73,3 +76,3 @@

if (index !== -1) return this._queue[index];
const buffer = new IntegerBufferSet({
const buffer = new IntegerBufferSet<ItemMeta>({
type,

@@ -89,2 +92,5 @@ getMetaType: this._getMetaType,

/**
* should be invoked after getIndices...
*/
reset() {

@@ -91,0 +97,0 @@ this.queue.forEach((buffer) => buffer.reset());

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