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

@dsnp/parquetjs

Package Overview
Dependencies
Maintainers
2
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dsnp/parquetjs - npm Package Compare versions

Comparing version 0.0.0-a8ddc9 to 0.0.0-ba6065

37

dist/lib/reader.js

@@ -24,2 +24,3 @@ 'use strict';

const groupBy = require("lodash/groupBy");
const fetch = require('cross-fetch');
const { getBloomFiltersFor, } = bloomFilterReader;

@@ -124,5 +125,5 @@ /**

*/
static openUrl(request, params, options) {
static openUrl(params, options) {
return __awaiter(this, void 0, void 0, function* () {
let envelopeReader = yield ParquetEnvelopeReader.openUrl(request, params, options);
let envelopeReader = yield ParquetEnvelopeReader.openUrl(params, options);
return this.openEnvelopeReader(envelopeReader, options);

@@ -348,3 +349,3 @@ });

}
static openUrl(request, params, options) {
static openUrl(params, options) {
return __awaiter(this, void 0, void 0, function* () {

@@ -357,30 +358,16 @@ if (typeof params === 'string')

base = base.slice(0, base.length - 1).join('/') + '/';
params.encoding = params.encoding || null;
let defaultHeaders = params.headers || {};
let filesize = () => __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
let req = request(params);
req.on('response', res => {
req.abort();
resolve(res.headers['content-length']);
});
req.on('error', reject);
});
const { headers } = yield fetch(params.url);
return headers.get('Content-Length');
});
let readFn = (offset, length, file) => {
let readFn = (offset, length, file) => __awaiter(this, void 0, void 0, function* () {
let url = file ? base + file : params.url;
let range = `bytes=${offset}-${offset + length - 1}`;
let headers = Object.assign({}, defaultHeaders, { range });
let req = Object.assign({}, params, { headers, url });
return new Promise((resolve, reject) => {
request(req, (err, res) => {
if (err) {
reject(err);
}
else {
resolve(res.body);
}
});
});
};
const response = yield fetch(url, { headers });
const arrayBuffer = yield response.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
return buffer;
});
let closeFn = () => ({});

@@ -387,0 +374,0 @@ return new ParquetEnvelopeReader(readFn, closeFn, filesize, options);

@@ -5,4 +5,3 @@ {

"main": "dist/parquet.js",
"types": "dist/parquet.d.ts",
"version": "0.0.0-a8ddc9",
"version": "0.0.0-ba6065",
"homepage": "https://github.com/LibertyDSNP/parquetjs",

@@ -26,2 +25,3 @@ "license": "MIT",

"bson": "^2.0.8",
"cross-fetch": "^3.1.4",
"int53": "^0.2.4",

@@ -47,2 +47,3 @@ "lodash": "^4.17.21",

"mocha": "8.3.2",
"msw": "^0.29.0",
"sinon": "^10.0.0",

@@ -52,3 +53,3 @@ "ts-node": "^9.1.1"

"scripts": {
"build": "tsc -b && tsc -p tsconfig.types.json && cp gen-nodejs/*.d.ts dist/gen-nodejs/",
"build": "tsc -b",
"type": "tsc --noEmit",

@@ -55,0 +56,0 @@ "lint": "echo 'Linting, it is on the TODO list...'",

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