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

vim-format

Package Overview
Dependencies
Maintainers
5
Versions
341
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vim-format - npm Package Compare versions

Comparing version 1.0.6-dev.240 to 1.0.6-dev.241

15

dist/http/remoteBuffer.d.ts

@@ -8,15 +8,2 @@ /**

export declare function setRemoteBufferMaxConcurency(value: number): void;
export declare class RetryRequest {
url: string;
range: string | undefined;
responseType: XMLHttpRequestResponseType;
msg: string | undefined;
xhr: XMLHttpRequest | undefined;
constructor(url: string, range: string | undefined, responseType: XMLHttpRequestResponseType);
onLoad: ((result: any) => void) | undefined;
onError: (() => void) | undefined;
onProgress: ((e: ProgressEvent<EventTarget>) => void) | undefined;
abort(): void;
send(): void;
}
/**

@@ -33,5 +20,3 @@ * Wrapper to provide tracking for all webrequests via request logger.

private _active;
private _encoded;
constructor(url: string);
private requestEncoding;
abort(): void;

@@ -38,0 +23,0 @@ http(range: Range | undefined, label: string): Promise<ArrayBuffer>;

72

dist/http/remoteBuffer.js

@@ -6,6 +6,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.RemoteBuffer = exports.RetryRequest = exports.setRemoteBufferMaxConcurency = void 0;
const remoteValue_1 = require("./remoteValue");
exports.RemoteBuffer = exports.setRemoteBufferMaxConcurency = void 0;
const requestTracker_1 = require("./requestTracker");
const logging_1 = require("./logging");
const retriableRequest_1 = require("./retriableRequest");
let RemoteBufferMaxConcurency = 10;

@@ -16,36 +16,2 @@ function setRemoteBufferMaxConcurency(value) {

exports.setRemoteBufferMaxConcurency = setRemoteBufferMaxConcurency;
class RetryRequest {
constructor(url, range,
// eslint-disable-next-line no-undef
responseType) {
this.url = url;
this.range = range;
this.responseType = responseType;
}
abort() {
this.xhr?.abort();
}
send() {
this.xhr?.abort();
const xhr = new XMLHttpRequest();
xhr.open('GET', this.url);
xhr.responseType = this.responseType;
if (this.range) {
xhr.setRequestHeader('Range', this.range);
}
xhr.onprogress = (e) => {
this.onProgress?.(e);
};
xhr.onload = (e) => {
this.onProgress?.(e);
this.onLoad?.(xhr.response);
};
xhr.onerror = (_) => {
this.onError?.();
};
xhr.send();
this.xhr = xhr;
}
}
exports.RetryRequest = RetryRequest;
/**

@@ -63,30 +29,3 @@ * Wrapper to provide tracking for all webrequests via request logger.

this._tracker.onUpdate = (p) => this.onProgress?.(p);
this._encoded = new remoteValue_1.RemoteValue(() => this.requestEncoding());
}
async requestEncoding() {
const xhr = new XMLHttpRequest();
xhr.open('HEAD', this.url);
xhr.send();
this.logs.log(`Requesting header for ${this.url}`);
const promise = new Promise((resolve, reject) => {
xhr.onload = (_) => {
let encoding;
try {
encoding = xhr.getResponseHeader('content-encoding');
}
catch (e) {
this.logs.error(e);
}
resolve(encoding ?? undefined);
};
xhr.onerror = (_) => resolve(undefined);
});
const encoding = await promise;
const encoded = !!encoding;
this.logs.log(`Encoding for ${this.url} = ${encoding}`);
if (encoded) {
this.logs.log(`Defaulting to download strategy for encoded content at ${this.url}`);
}
return encoded;
}
abort() {

@@ -100,8 +39,7 @@ this._active.forEach(request => {

async http(range, label) {
const useRange = range && !(await this._encoded.get());
const rangeStr = useRange
const rangeStr = range
? `bytes=${range.start}-${range.end - 1}`
: undefined;
const request = new RetryRequest(this.url, rangeStr, 'arraybuffer');
request.msg = useRange
const request = new retriableRequest_1.RetriableRequest(this.url, rangeStr, 'arraybuffer');
request.msg = range
? `${label} : [${range.start}, ${range.end}] of ${this.url}`

@@ -108,0 +46,0 @@ : `${label} of ${this.url}`;

4

dist/http/requester.js

@@ -5,3 +5,3 @@ "use strict";

const logging_1 = require("./logging");
const remoteBuffer_1 = require("./remoteBuffer");
const retriableRequest_1 = require("./retriableRequest");
const requestTracker_1 = require("./requestTracker");

@@ -28,3 +28,3 @@ /**

async http(url, label) {
const request = new remoteBuffer_1.RetryRequest(url, undefined, 'arraybuffer');
const request = new retriableRequest_1.RetriableRequest(url, undefined, 'arraybuffer');
request.msg = url;

@@ -31,0 +31,0 @@ this.enqueue(request);

@@ -8,15 +8,2 @@ /**

export declare function setRemoteBufferMaxConcurency(value: number): void;
export declare class RetryRequest {
url: string;
range: string | undefined;
responseType: XMLHttpRequestResponseType;
msg: string | undefined;
xhr: XMLHttpRequest | undefined;
constructor(url: string, range: string | undefined, responseType: XMLHttpRequestResponseType);
onLoad: ((result: any) => void) | undefined;
onError: (() => void) | undefined;
onProgress: ((e: ProgressEvent<EventTarget>) => void) | undefined;
abort(): void;
send(): void;
}
/**

@@ -33,5 +20,3 @@ * Wrapper to provide tracking for all webrequests via request logger.

private _active;
private _encoded;
constructor(url: string);
private requestEncoding;
abort(): void;

@@ -38,0 +23,0 @@ http(range: Range | undefined, label: string): Promise<ArrayBuffer>;

{
"name": "vim-format",
"version": "1.0.6-dev.240",
"version": "1.0.6-dev.241",
"description": "The VIM format is a modern and efficient open 3D data interchange format designed for BIM and manufacturing data optimized for efficient loading and rendering on low-power devices.",

@@ -5,0 +5,0 @@ "directories": {

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