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

@travetto/base

Package Overview
Dependencies
Maintainers
1
Versions
357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/base - npm Package Compare versions

Comparing version 4.0.6 to 4.1.0

8

package.json
{
"name": "@travetto/base",
"version": "4.0.6",
"version": "4.1.0",
"description": "Environment config and common utilities for travetto applications.",

@@ -27,9 +27,9 @@ "keywords": [

"dependencies": {
"@travetto/manifest": "^4.0.3",
"@travetto/manifest": "^4.1.0",
"@types/debug": "^4.1.12",
"@types/node": "^20.11.25",
"@types/node": "^20.12.12",
"debug": "^4.3.4"
},
"peerDependencies": {
"@travetto/transformer": "^4.0.4"
"@travetto/transformer": "^4.1.0"
},

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

@@ -50,3 +50,3 @@ export type ErrorCategory =

this.type = this.constructor.name;
this.stack = stack || this.stack; // eslint-disable-line no-self-assign
this.stack = stack || this.stack;
this.details = details!;

@@ -53,0 +53,0 @@ }

@@ -6,2 +6,3 @@ import rl from 'node:readline/promises';

import { pipeline } from 'node:stream/promises';
import { AppError } from './error';

@@ -105,2 +106,17 @@ type All = Buffer | string | Readable | Uint8Array | NodeJS.ReadableStream | WebReadableStream;

}
/**
* Enforce byte range for stream stream/file of a certain size
*/
static enforceRange(start: number, end: number | undefined, size: number): [start: number, end: number] {
end ??= size - 1;
if (Number.isNaN(start) || Number.isNaN(end) || !Number.isFinite(start) || start >= size || start < 0) {
throw new AppError('Invalid position, out of range', 'data');
}
if (end >= size) {
end = size - 1;
}
return [start, end];
}
}
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