Socket
Socket
Sign inDemoInstall

@codemirror/lang-json

Package Overview
Dependencies
10
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.18.0 to 0.19.0

10

CHANGELOG.md

@@ -0,3 +1,13 @@

## 0.19.0 (2021-08-11)
### Breaking changes
Update dependencies to 0.19.0
## 0.18.0 (2021-03-03)
### Breaking changes
Update dependencies to 0.18.
## 0.17.1 (2021-01-06)

@@ -4,0 +14,0 @@

16

dist/index.d.ts

@@ -1,10 +0,22 @@

import { LezerLanguage, LanguageSupport } from '@codemirror/language';
import { LRLanguage, LanguageSupport } from '@codemirror/language';
import { Diagnostic } from '@codemirror/lint';
import { EditorView } from '@codemirror/view';
/**
Calls
[`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)
on the document and, if that throws an error, reports it as a
single diagnostic.
*/
declare const jsonParseLinter: () => (view: EditorView) => Diagnostic[];
declare const jsonLanguage: LezerLanguage;
/**
A language provider that provides JSON parsing.
*/
declare const jsonLanguage: LRLanguage;
/**
JSON language support.
*/
declare function json(): LanguageSupport;
export { json, jsonLanguage, jsonParseLinter };

36

dist/index.js

@@ -1,9 +0,11 @@

import { parser } from 'lezer-json';
import { LezerLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';
import { parser } from '@lezer/json';
import { LRLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';
import { styleTags, tags } from '@codemirror/highlight';
/// Calls
/// [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)
/// on the document and, if that throws an error, reports it as a
/// single diagnostic.
/**
Calls
[`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)
on the document and, if that throws an error, reports it as a
single diagnostic.
*/
const jsonParseLinter = () => (view) => {

@@ -35,14 +37,16 @@ try {

/// A language provider that provides JSON parsing.
const jsonLanguage = LezerLanguage.define({
parser: parser.configure({
/**
A language provider that provides JSON parsing.
*/
const jsonLanguage = /*@__PURE__*/LRLanguage.define({
parser: /*@__PURE__*/parser.configure({
props: [
indentNodeProp.add({
Object: continuedIndent({ except: /^\s*\}/ }),
Array: continuedIndent({ except: /^\s*\]/ })
/*@__PURE__*/indentNodeProp.add({
Object: /*@__PURE__*/continuedIndent({ except: /^\s*\}/ }),
Array: /*@__PURE__*/continuedIndent({ except: /^\s*\]/ })
}),
foldNodeProp.add({
/*@__PURE__*/foldNodeProp.add({
"Object Array": foldInside
}),
styleTags({
/*@__PURE__*/styleTags({
String: tags.string,

@@ -64,3 +68,5 @@ Number: tags.number,

});
/// JSON language support.
/**
JSON language support.
*/
function json() {

@@ -67,0 +73,0 @@ return new LanguageSupport(jsonLanguage);

{
"name": "@codemirror/lang-json",
"version": "0.18.0",
"version": "0.19.0",
"description": "JSON language support for the CodeMirror code editor",
"scripts": {
"test": "echo 'No tests'",
"prepare": "tsc -p tsconfig.local.json && rollup -c"
"test": "cm-runtests",
"prepare": "cm-buildhelper src/json.ts"
},

@@ -29,10 +29,8 @@ "keywords": [

"dependencies": {
"@codemirror/highlight": "^0.18.0",
"@codemirror/language": "^0.18.0",
"lezer-json": "^0.13.0"
"@codemirror/highlight": "^0.19.0",
"@codemirror/language": "^0.19.0",
"@lezer/json": "^0.14.0"
},
"devDependencies": {
"rollup": "^2.35.1",
"rollup-plugin-dts": "^2.0.1",
"typescript": "^4.1.3"
"@codemirror/buildhelper": "^0.1.0"
},

@@ -39,0 +37,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc