Socket
Socket
Sign inDemoInstall

stream-transform

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-transform - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

53

lib/index.js

@@ -1,16 +0,5 @@

// Generated by CoffeeScript 2.0.1
// # Stream Transformer
// Generated by CoffeeScript 1.12.7
var Transformer, stream, util,
slice = [].slice;
// Pass all elements of an array or a stream to transform, filter and add. Features include:
// * Extends the Node.js "stream.Transform" API.
// * Both synchrounous and asynchronous support based and user callback
// arguments signature.
// * Ability to skip data.
// * Sequential and concurrent execution using the "parallel" options.
// Please look at the [README], the [samples] and the [tests] for additional
// information.
var Transformer, stream, util;
stream = require('stream');

@@ -20,11 +9,2 @@

// ## Usage
// Callback approach, for ease of use:
// `transform(handler, [options])`
// Stream API, for maximum of power:
// `transform(data, [options], handler, [options], [callback])`
module.exports = function() {

@@ -108,8 +88,5 @@ var argument, callback, data, error, handler, i, j, k, len, options, result, transform, type, v;

// ## Transformer
// Options are documented [here](http://csv.adaltas.com/transform/).
Transformer = function(options1 = {}, transform1) {
Transformer = function(options1, transform1) {
var base;
this.options = options1;
this.options = options1 != null ? options1 : {};
this.transform = transform1;

@@ -144,8 +121,12 @@ this.options.objectMode = true;

}
if (l === 1) { // sync
if (l === 1) {
this._done(null, [this.transform.call(null, chunk, this.options.params)], cb);
} else if (l === 2) { // async
callback = (err, ...chunks) => {
return this._done(err, chunks, cb);
};
} else if (l === 2) {
callback = (function(_this) {
return function() {
var chunks, err;
err = arguments[0], chunks = 2 <= arguments.length ? slice.call(arguments, 1) : [];
return _this._done(err, chunks, cb);
};
})(this);
this.transform.call(null, chunk, callback, this.options.params);

@@ -181,3 +162,3 @@ } else {

if (typeof chunk === 'number') {
chunk = `${chunk}`;
chunk = "" + chunk;
}

@@ -195,5 +176,1 @@ if (chunk != null) {

};
// [readme]: https://github.com/wdavidw/node-stream-transform
// [samples]: https://github.com/wdavidw/node-stream-transform/tree/master/samples
// [tests]: https://github.com/wdavidw/node-stream-transform/tree/master/test
{
"version": "0.2.1",
"version": "0.2.2",
"name": "stream-transform",

@@ -4,0 +4,0 @@ "description": "Object transformations implementing the Node.js `stream.Transform` API",

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