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

@travetto/asset

Package Overview
Dependencies
Maintainers
1
Versions
310
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/asset - npm Package Compare versions

Comparing version 4.0.10 to 4.1.0

8

package.json
{
"name": "@travetto/asset",
"version": "4.0.10",
"version": "4.1.0",
"description": "Modular library for storing and retrieving binary assets",

@@ -28,4 +28,4 @@ "keywords": [

"dependencies": {
"@travetto/di": "^4.0.7",
"@travetto/model": "^4.0.7",
"@travetto/di": "^4.1.0",
"@travetto/model": "^4.1.0",
"@types/mime": "^3.0.4",

@@ -36,3 +36,3 @@ "file-type": "^16.5.4",

"peerDependencies": {
"@travetto/test": "^4.0.7"
"@travetto/test": "^4.1.0"
},

@@ -39,0 +39,0 @@ "peerDependenciesMeta": {

@@ -1,2 +0,2 @@

import { Readable } from 'node:stream';
import { PassThrough } from 'node:stream';

@@ -88,13 +88,13 @@ import { Inject, Injectable } from '@travetto/di';

const info = await this.describe(location);
let stream: Readable;
let extra: Partial<AssetResponse> | undefined;
const stream = new PassThrough();
const extra: Partial<AssetResponse> = {};
let load: () => void;
if (start === undefined) {
stream = await this.#store.getStream(location);
load = (): void => { this.#store.getStream(location).then(v => v.pipe(stream)); };
} else {
const res = await this.#store.getStreamPartial(location, start, end);
stream = res.stream;
extra = { range: res.range };
extra.range = StreamUtil.enforceRange(start, end, info.size);
load = (): void => { this.#store.getStreamPartial(location, start, end).then(v => v.stream.pipe(stream)); };
}
return { stream: () => stream, ...info, ...extra };
return { stream: () => (load(), stream), ...info, ...extra };
}
}
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