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

protocol-buffers-schema

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

protocol-buffers-schema - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

test/fixtures/options.json

2

package.json
{
"name": "protocol-buffers-schema",
"version": "2.0.3",
"version": "2.0.4",
"description": "No nonsense protocol buffers schema parser written in Javascript",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,3 +18,2 @@ var tokenize = require('./tokenize')

break
case ']':

@@ -332,2 +331,21 @@ tokens.shift()

var tokens = tokenize(buf.toString())
// check for isolated strings in tokens by looking for opening quote
for (var i = 0; i < tokens.length; i++) {
if (/^(\"|\')([^\'\"]*)$/.test(tokens[i])) {
var j
if (tokens[i].length === 1) {
j = i + 1
} else {
j = i
}
// look ahead for the closing quote and collapse all
// in-between tokens into a single token
for (j; j < tokens.length; j++) {
if (/^([^\'\"]*)(\"|\')$/.test(tokens[j])) {
tokens = tokens.slice(0, i).concat(tokens.slice(i, j + 1).join('')).concat(tokens.slice(j + 1))
break
}
}
}
}
var schema = {

@@ -334,0 +352,0 @@ syntax: 3,

@@ -95,1 +95,6 @@ var tape = require('tape')

})
tape('schema with reserved characters in options', function (t) {
t.same(schema.parse(fixture('options.proto')), require('./fixtures/options.json'))
t.end()
})
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