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

nofilter

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nofilter - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

19

lib/index.js

@@ -34,2 +34,4 @@ 'use strict'

* input stream
* @param {boolean} [options.readError=false] - If true, when a read()
* underflows, throw an error.
*

@@ -88,4 +90,8 @@ * @example <caption>source</caption>

delete options.watchPipe
const readError = !! options.readError
delete options.readError
super(options)
this.readError = readError
if (watchPipe) {

@@ -225,2 +231,3 @@ this.on('pipe', readable => {

* decoding output a string, otherwise a Buffer
* @throws Error - if readError is true and there was underflow
* @fires NoFilter#read

@@ -239,2 +246,7 @@ */

this.emit('read', buf)
if (this.readError && (buf.length < size)) {
throw new Error(`Read ${buf.length}, wanted ${size}`)
}
} else if (this.readError) {
throw new Error(`No data available, wanted ${size}`)
}

@@ -373,2 +385,9 @@ return buf

toString(encoding, start, end) {
if ((!encoding || (encoding === 'utf8')) && util.TextDecoder) {
const td = new util.TextDecoder('utf8', {
fatal: true,
ignoreBOM: true
})
return td.decode(this.slice(start, end))
}
return this.slice().toString(encoding, start, end)

@@ -375,0 +394,0 @@ }

13

package.json
{
"name": "nofilter",
"version": "1.0.1",
"version": "1.0.2",
"description": "Read and write a growable buffer as a stream",

@@ -9,8 +9,5 @@ "main": "lib/index.js",

"lint": "eslint lib/*.js bin/* test/*.js",
"coverage": "nyc -r none npm test",
"coveragehtml": "nyc report -r html",
"precoveragehtml": "npm run coverage",
"coverage": "nyc -r html npm test",
"test": "mocha test/*.js",
"doc": "jsdoc -c .jsdoc.conf",
"watch": "watch 'npm run coveragehtml' src/ test/",
"release": "npm version patch && git push --follow-tags && npm publish",

@@ -43,7 +40,7 @@ "coveralls": "nyc report --reporter=text-lcov | coveralls"

"chai": "^4.2",
"coveralls": "^3.0.2",
"coveralls": "^3.0.3",
"jsdoc": "^3.5.5",
"minami": "^1.2.3",
"mocha": "^5.2.0",
"nyc": "^13.1.0"
"mocha": "^6.0.2",
"nyc": "^13.3.0"
},

@@ -50,0 +47,0 @@ "engines": {

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