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

jsonext

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonext - npm Package Compare versions

Comparing version 0.0.2-beta to 0.0.3-beta

4

package.json
{
"name": "jsonext",
"version": "0.0.2-beta",
"version": "0.0.3-beta",
"description": "An extension of JSON that supports the next generation of ECMAScript features",

@@ -10,3 +10,3 @@ "main": "src/",

"scripts": {
"lint": "eslint . --fix",
"lint": "eslint src/ --fix",
"test": "nyc --reporter=html --reporter=text mocha"

@@ -13,0 +13,0 @@ },

# JSONext
This pre-release version supports JSON5 syntax but does not yet support
`reviver` and only wraps `JSON.stringify`.
This pre-release version supports JSON5 syntax plus ES6 templates but does not
yet support `reviver` and only wraps `JSON.stringify`.

@@ -103,2 +103,5 @@ let text

return
case undefined:
return newToken('eof')
}

@@ -135,4 +138,9 @@

multiLineComment () {
if (c === '*') {
switch (c) {
case '*':
lexState = 'multiLineCommentAsterisk'
break
case undefined:
throw invalidChar(c)
}

@@ -144,2 +152,6 @@

multiLineCommentAsterisk () {
if (c === undefined) {
throw invalidChar(c)
}
read()

@@ -157,2 +169,5 @@ lexState = (c === '/') ? 'default' : 'multiLineComment'

break
case undefined:
return newToken('eof')
}

@@ -231,4 +246,11 @@

doubleQuote = (read() === '"')
buffer = ''
lexState = 'string'
return
case '`':
read()
buffer = ''
lexState = 'template'
return
}

@@ -598,2 +620,5 @@

break
case undefined:
throw invalidChar()
}

@@ -605,2 +630,47 @@

template () {
switch (c) {
case '$':
buffer += read()
lexState = 'templateDollar'
return
case '\\':
read()
buffer += escape()
return
case '\r':
read()
if (peek() === '\n') {
read()
}
buffer += '\n'
return
case '`':
read()
return newToken('string', buffer)
case undefined:
throw invalidChar()
}
buffer += read()
return
},
templateDollar () {
switch (c) {
case '{':
case undefined:
throw invalidChar(c)
}
buffer += read()
lexState = 'template'
return
},
start () {

@@ -793,2 +863,5 @@ switch (c) {

return '\n'
case undefined:
throw invalidChar(c)
}

@@ -1037,2 +1110,6 @@

function invalidChar (c) {
if (c === undefined) {
return new SyntaxError(`JSONext: invalid end of input at ${line}:${column}`)
}
return new SyntaxError(`JSONext: invalid character '${c}' at ${line}:${column}`)

@@ -1042,2 +1119,6 @@ }

function invalidToken () {
if (token.type === 'eof') {
return new SyntaxError(`JSONext: invalid end of input at ${line}:${column}`)
}
const c = String.fromCodePoint(token.value.codePointAt(0))

@@ -1044,0 +1125,0 @@ return new SyntaxError(`JSONext: invalid character '${c}' at ${line}:${column}`)

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