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

@tus/utils

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tus/utils - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

dist/kvstores/IoRedisKvStore.d.ts

1

dist/kvstores/index.d.ts
export { FileKvStore } from './FileKvStore';
export { MemoryKvStore } from './MemoryKvStore';
export { RedisKvStore } from './RedisKvStore';
export { IoRedisKvStore } from './IoRedisKvStore';
export { KvStore } from './Types';
//# sourceMappingURL=index.d.ts.map

4

dist/kvstores/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RedisKvStore = exports.MemoryKvStore = exports.FileKvStore = void 0;
exports.IoRedisKvStore = exports.RedisKvStore = exports.MemoryKvStore = exports.FileKvStore = void 0;
var FileKvStore_1 = require("./FileKvStore");

@@ -10,2 +10,4 @@ Object.defineProperty(exports, "FileKvStore", { enumerable: true, get: function () { return FileKvStore_1.FileKvStore; } });

Object.defineProperty(exports, "RedisKvStore", { enumerable: true, get: function () { return RedisKvStore_1.RedisKvStore; } });
var IoRedisKvStore_1 = require("./IoRedisKvStore");
Object.defineProperty(exports, "IoRedisKvStore", { enumerable: true, get: function () { return IoRedisKvStore_1.IoRedisKvStore; } });
//# sourceMappingURL=index.js.map

@@ -26,3 +26,11 @@ "use strict";

async list() {
return this.redis.keys(`${this.prefix}*`);
const keys = new Set();
let cursor = 0;
do {
const result = await this.redis.scan(cursor, { MATCH: `${this.prefix}*`, COUNT: 20 });
cursor = result.cursor;
for (const key of result.keys)
keys.add(key);
} while (cursor !== 0);
return Array.from(keys);
}

@@ -29,0 +37,0 @@ serializeValue(value) {

{
"$schema": "https://json.schemastore.org/package.json",
"name": "@tus/utils",
"version": "0.4.0",
"version": "0.5.0",
"description": "Internal utils for tus Node.js server and stores",

@@ -25,2 +25,3 @@ "main": "dist/index.js",

"@types/node": "^20.11.5",
"ioredis": "^5.4.1",
"mocha": "^10.4.0",

@@ -27,0 +28,0 @@ "should": "^13.2.3",

export {FileKvStore} from './FileKvStore'
export {MemoryKvStore} from './MemoryKvStore'
export {RedisKvStore} from './RedisKvStore'
export {IoRedisKvStore} from './IoRedisKvStore'
export {KvStore} from './Types'

@@ -32,3 +32,10 @@ import type {RedisClientType} from '@redis/client'

async list(): Promise<Array<string>> {
return this.redis.keys(`${this.prefix}*`)
const keys = new Set<string>()
let cursor = 0
do {
const result = await this.redis.scan(cursor, {MATCH: `${this.prefix}*`, COUNT: 20})
cursor = result.cursor
for (const key of result.keys) keys.add(key)
} while (cursor !== 0)
return Array.from(keys)
}

@@ -35,0 +42,0 @@

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

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