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

json-parser

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-parser - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "json-parser",
"version": "2.0.0",
"version": "2.0.1",
"description": "JSON parser to parse JSON object and MAINTAIN comments.",

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

@@ -105,10 +105,27 @@ [![Build Status](https://travis-ci.org/kaelzhang/node-json-parser.svg?branch=master)](https://travis-ci.org/kaelzhang/node-json-parser)

- `Symbol.for('before-all')` comment tokens before the JSON object
- `Symbol.for('before')` comment tokens before any properties/items inside an object/array
- `Symbol.for(\`after-prop:${prop}\`)` comment tokens after property key `prop` and before colon(`:`)
- `Symbol.for(\`after-colon:${prop}\`)` comment tokens after the colon(`:`) of property `prop` and before property value
- `Symbol.for(\`after-value:${prop}\`)` comment tokens after the value of property `prop`/the item of index `prop` and before the key-value/item delimiter(`,`)
- `Symbol.for(\`after-comma:${prop}\`)` comment tokens after the comma of `prop`-value pair and before the next key-value pair/item
- `Symbol.for('after-all')` comment tokens after the JSON object
```js
// comment tokens before the JSON object
Symbol.for('before-all')
// comment tokens before any properties/items inside an object/array
Symbol.for('before')
// comment tokens after property key `prop` and before colon(`:`)
Symbol.for(`after-prop:${prop}`)
// comment tokens after the colon(`:`) of property `prop` and before property value
Symbol.for(`after-colon:${prop}`)
// comment tokens after the value of property `prop`/the item of index `prop`
// and before the key-value/item delimiter(`,`)
Symbol.for(`after-value:${prop}`)
// comment tokens after the comma of `prop`-value pair
// and before the next key-value pair/item
Symbol.for(`after-comma:${prop}`)
// comment tokens after the JSON object
Symbol.for('after-all')
```
And the value of each symbol property is an **array** of `CommentToken`

@@ -115,0 +132,0 @@

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