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

dcp-rds

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dcp-rds - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

40

lib/utils.js

@@ -76,3 +76,2 @@ /**

/** Inner function - handles 404 but not 5xx */

@@ -183,40 +182,1 @@ exports.sendFile = function utils$$sendFile(response, contentType, filenameStub)

}
/**
* Enable logging from a stream.
* E.g.
* stream = fs.createReadStream(filename, {encoding: 'binary'});
* logChunks(stream);
*
* @param {*} readable - a readable stream.
*/
async function logChunks(readableStream) {
for await (const data of readableStream) {
console.log(typeof data, data.constructor);
if (typeof data === 'string') {
for (let k = 0; k < data.length; k++)
console.log(`codePointAt(${k}): ${data.codePointAt(k).toString(16)}`);
}
}
}
/**
* Quck and dirty JSON serialization that ignores cycles.
*
* @param {*} o - entity to be serialized.
* @param {number} len - number of string elements to return.
* @returns {string}
*/
exports.stringify = function _stringify(o, len = 512) {
if (!o) return 'nada';
let cache = [];
const str = JSON.stringify(o, (key, value) => {
if (typeof value === 'object' && value !== null) {
if (cache.includes(value)) return;
cache.push(value);
}
return value;
});
cache = null;
return str.slice(0, len);
}

@@ -40,3 +40,2 @@ /**

//console.log('dcp-rds:utils:download', pathSuffixComponents);
if (!pathSuffixComponents || pathSuffixComponents.length !== 5)

@@ -54,6 +53,2 @@ throw new Error(`Could not parse URL components of ${request.url} (${pathSuffix})`, 'BAD_REQUEST_URL');

//console.log('\ndcp-rds:utils:download-response', utils.stringify(response));
//console.log('\ndcp-rds:utils:download-request', utils.stringify(request));
//console.log('\ndcp-rds:utils:download-query', utils.stringify(query));
utils.sendContent(response, job, elementType, element);

@@ -60,0 +55,0 @@ return false;

3

libexec/upload.js

@@ -39,6 +39,5 @@ /**

var location = utils.getLocation(request);
var methodPath = location.pathname.replace(/\/upload$/, '');
var methodPath = location.pathname.replace(/\/upload.*$/, '');
var href = `${location.protocol}//${location.host}${methodPath}/download/jobs/${job}/${elementType}/${element}`;
//console.log(`dcp-rds:utils:upload query ${utils.stringify(query)}\n`);
if (!Object.hasOwnProperty.call(query, 'content'))

@@ -45,0 +44,0 @@ throw new Error('query missing content');

{
"name": "dcp-rds",
"version": "1.0.4",
"version": "1.0.5",
"description": "DCP Remote Data Service reference implementation",

@@ -39,6 +39,6 @@ "scripts": {

"dependencies": {
"kvin": "^1.2.5",
"kvin": "^1.2.6",
"multipart-formdata": "^1.1.0",
"nanoid": "^3.1.29"
"nanoid": "^3.1.30"
}
}

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