into-stream
Advanced tools
Comparing version 2.0.1 to 3.0.0
16
index.js
'use strict'; | ||
var from = require('from2'); | ||
const from = require('from2'); | ||
module.exports = function (x) { | ||
module.exports = x => { | ||
if (Array.isArray(x)) { | ||
@@ -9,3 +9,3 @@ x = x.slice(); | ||
return from(function (size, cb) { | ||
return from((size, cb) => { | ||
if (x.length === 0) { | ||
@@ -21,9 +21,10 @@ cb(null, null); | ||
var chunk = x.slice(0, size); | ||
const chunk = x.slice(0, size); | ||
x = x.slice(size); | ||
cb(null, chunk); | ||
setImmediate(cb, null, chunk); | ||
}); | ||
}; | ||
module.exports.obj = function (x) { | ||
module.exports.obj = x => { | ||
if (Array.isArray(x)) { | ||
@@ -45,4 +46,5 @@ x = x.slice(); | ||
this.push(x); | ||
cb(null, null); | ||
setImmediate(cb, null, null); | ||
}); | ||
}; |
{ | ||
"name": "into-stream", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "Convert a buffer/string/array/object into a stream", | ||
@@ -13,3 +13,3 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"node": ">=4" | ||
}, | ||
@@ -45,5 +45,5 @@ "scripts": { | ||
"buffer-equals": "^1.0.3", | ||
"concat-stream": "^1.4.8", | ||
"get-stream": "^2.1.0", | ||
"xo": "*" | ||
} | ||
} |
@@ -29,3 +29,3 @@ # into-stream [![Build Status](https://travis-ci.org/sindresorhus/into-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/into-stream) | ||
Type: `buffer` `string` `array<buffer|string>`<br> | ||
Type: `Buffer` `string` `Array<Buffer|string>`<br> | ||
Returns: [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) | ||
@@ -32,0 +32,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3516