Socket
Socket
Sign inDemoInstall

@serialport/parser-regex

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serialport/parser-regex - npm Package Compare versions

Comparing version 1.0.5 to 2.0.1

CHANGELOG.md

11

package.json
{
"name": "@serialport/parser-regex",
"main": "regex.js",
"version": "1.0.5",
"dependencies": {
"safe-buffer": "^5.1.1"
"version": "2.0.1",
"engines": {
"node": ">=6.0.0"
},

@@ -14,4 +14,5 @@ "publishConfig": {

"type": "git",
"url": "git://github.com/node-serialport/parsers.git"
}
"url": "git://github.com/node-serialport/node-serialport.git"
},
"gitHead": "40a06fb71d659940ed5058316b594b9da9957c2f"
}

@@ -1,1 +0,1 @@

See our api docs https://node-serialport.github.io/parsers/RegexParser.html
See our api docs https://node-serialport.github.io/node-serialport/RegexParser.html

@@ -1,2 +0,1 @@

'use strict'
const Transform = require('stream').Transform

@@ -17,9 +16,14 @@

class RegexParser extends Transform {
constructor (options) {
const opts = Object.assign({
encoding: 'utf8'
}, options)
constructor(options) {
const opts = Object.assign(
{
encoding: 'utf8',
},
options
)
if (opts.regex === undefined) {
throw new TypeError('"options.regex" must be a regular expression pattern or object')
throw new TypeError(
'"options.regex" must be a regular expression pattern or object'
)
}

@@ -36,3 +40,3 @@

_transform (chunk, encoding, cb) {
_transform(chunk, encoding, cb) {
const data = this.data + chunk

@@ -42,3 +46,3 @@ const parts = data.split(this.regex)

parts.forEach((part) => {
parts.forEach(part => {
this.push(part)

@@ -49,3 +53,3 @@ })

_flush (cb) {
_flush(cb) {
this.push(this.data)

@@ -52,0 +56,0 @@ this.data = ''

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