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

json-cst

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-cst - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

9

dist/cst.js

@@ -85,9 +85,4 @@ import lexer from 'json-lexer';

let whitespaceAfterChildren;
// const node: Omit< CstNodeObject, 'range' > = {
// kind: 'object',
// children: [ ],
// whitespaceAfterChildren: undefined,
// };
let i = pos;
for (; i < tokens.length; ++i) {
for (; i < tokens.length;) {
const propStartToken = tokens[i];

@@ -149,3 +144,3 @@ const firstToken = nextNonWhitespaceToken(tokens, i);

let i = pos;
for (; i < tokens.length; ++i) {
for (; i < tokens.length;) {
const elemStartToken = tokens[i];

@@ -152,0 +147,0 @@ const firstToken = nextNonWhitespaceToken(tokens, i);

{
"name": "json-cst",
"version": "1.0.0",
"version": "1.0.1",
"description": "Parse JSON into CST (Concrete Syntax Tree)",

@@ -5,0 +5,0 @@ "author": "Gustaf Räntilä",

@@ -10,5 +10,7 @@ [![npm version][npm-image]][npm-url]

This package parses a JSON into CST (Concrete Syntax Tree), similar to an AST but more low-level and with ties to the lexer tokens. It uses `json-lexer` to parse the file into tokens. The speed is practically the same as `json-to-ast` (it's ~10% faster than `json-to-ast`), but it's far smaller (even including `json-lexer`).
This package parses a JSON into CST (Concrete Syntax Tree), similar to an AST but more low-level and with ties to the lexer tokens. It uses `json-lexer` to parse the file into tokens. The speed is practically the same as [`json-to-ast`](https://www.npmjs.com/package/json-to-ast) (it's ~10% faster than `json-to-ast`), but it's far smaller (even including `json-lexer`). Pure package is 7x smaller, install size 12x smaller, bundling it makes it 6x smaller according to bundlephobia ([json-to-ast](https://bundlephobia.com/package/json-to-ast@2.1.0) vs [json-cst](https://bundlephobia.com/package/json-cst@1.0.0)).
It comes with TypeScript typings.
# Install

@@ -63,3 +65,3 @@

start: number;
end: number;
end: number;
}

@@ -66,0 +68,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